@olympeio/runtime-node 9.8.0 → 9.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.js CHANGED
@@ -207,32 +207,32 @@ ea('Symbol.asyncIterator',function(a){return a?a:Symbol('Symbol.asyncIterator')}
207
207
  function ha(a){var b=a[Symbol.asyncIterator];if(void 0!==b)a=b.call(a);else{b=ia;var c='undefined'!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];a=c?c.call(a):{next:aa(a)};a=new b(a)}return a}
208
208
  function ia(a){this[Symbol.asyncIterator]=function(){return this};this[Symbol.iterator]=function(){return a};this.next=function(b){return Promise.resolve(a.next(b))};void 0!==a['throw']&&(this['throw']=function(b){return Promise.resolve(a['throw'](b))});void 0!==a['return']&&(this['return']=function(b){return Promise.resolve(a['return'](b))})}function ja(a,b){this.C=a;this.value=b}function ka(a,b,c,d){this.method=a;this.C=b;this.resolve=c;this.F=d}function la(a){this.C=a;this.next=null}
209
209
  function ma(){this.F=this.C=null}ma.prototype.af=function(){return null===this.C};ma.prototype.first=function(){if(this.C)return this.C.C;throw Error('no frames in executionQueue');};function na(a){a.C&&(a.C=a.C.next,a.C||(a.F=null))}
210
- function oa(a){this.J=a;this.F=null;this.C=new ma;this[Symbol.asyncIterator]=function(){return this};var b=this;this.T=function(c){var d=b.C.first();!0===c.done?(b.F=null,d.method='next',d.C=c.value):(d.resolve({value:c.value,done:!1}),na(b.C));pa(b)};this.O=function(c){qa(b,c)};this.G=function(c){ra(b,c)}}function sa(a,b,c){return new Promise(function(d,e){var f=a.C.af(),g=a.C;d=new la(new ka(b,c,d,e));g.F?g.F.next=d:g.C=d;g.F=d;f&&pa(a)})}oa.prototype.next=function(a){return sa(this,'next',a)};
210
+ function oa(a){this.K=a;this.F=null;this.C=new ma;this[Symbol.asyncIterator]=function(){return this};var b=this;this.T=function(c){var d=b.C.first();!0===c.done?(b.F=null,d.method='next',d.C=c.value):(d.resolve({value:c.value,done:!1}),na(b.C));pa(b)};this.O=function(c){qa(b,c)};this.G=function(c){ra(b,c)}}function sa(a,b,c){return new Promise(function(d,e){var f=a.C.af(),g=a.C;d=new la(new ka(b,c,d,e));g.F?g.F.next=d:g.C=d;g.F=d;f&&pa(a)})}oa.prototype.next=function(a){return sa(this,'next',a)};
211
211
  oa.prototype.return=function(a){return sa(this,'return',new ja(0,a))};oa.prototype.throw=function(a){return sa(this,'throw',a)};function pa(a){if(!a.C.af())try{if(a.F){if(!a.F)throw Error('no delegate to perform execution');var b=a.C.first();if(b.method in a.F)try{a.F[b.method](b.C).then(a.T,a.O).catch(a.G)}catch(c){qa(a,c)}else a.F=null,pa(a)}else ta(a)}catch(c){ra(a,c)}}
212
- function ta(a){var b=a.C.first();try{var c=a.J[b.method](b.C);if(c.value instanceof ja)switch(c.value.C){case 0:Promise.resolve(c.value.value).then(function(d){b.resolve({value:d,done:c.done});na(a.C);pa(a)},function(d){b.F(d);na(a.C);pa(a)}).catch(a.G);break;case 1:a.F=ha(c.value.value);b.method='next';b.C=void 0;pa(a);break;case 2:Promise.resolve(c.value.value).then(function(d){b.method='next';b.C=d;pa(a)},function(d){b.method='throw';b.C=d;pa(a)}).catch(a.G);break;default:throw Error('Unrecognized AsyncGeneratorWrapper$ActionEnum');
213
- }else b.resolve(c),na(a.C),pa(a)}catch(d){b.F(d),na(a.C),pa(a)}}function qa(a,b){var c=a.C.first();a.F=null;c.method='throw';c.C=b;pa(a)}function ra(a,b){a.C.af()||(a.C.first().F(b),na(a.C));a.F&&'return'in a.F&&(a.F['return'](void 0),a.F=null);a.J['return'](void 0);pa(a)}ea('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
212
+ function ta(a){var b=a.C.first();try{var c=a.K[b.method](b.C);if(c.value instanceof ja)switch(c.value.C){case 0:Promise.resolve(c.value.value).then(function(d){b.resolve({value:d,done:c.done});na(a.C);pa(a)},function(d){b.F(d);na(a.C);pa(a)}).catch(a.G);break;case 1:a.F=ha(c.value.value);b.method='next';b.C=void 0;pa(a);break;case 2:Promise.resolve(c.value.value).then(function(d){b.method='next';b.C=d;pa(a)},function(d){b.method='throw';b.C=d;pa(a)}).catch(a.G);break;default:throw Error('Unrecognized AsyncGeneratorWrapper$ActionEnum');
213
+ }else b.resolve(c),na(a.C),pa(a)}catch(d){b.F(d),na(a.C),pa(a)}}function qa(a,b){var c=a.C.first();a.F=null;c.method='throw';c.C=b;pa(a)}function ra(a,b){a.C.af()||(a.C.first().F(b),na(a.C));a.F&&'return'in a.F&&(a.F['return'](void 0),a.F=null);a.K['return'](void 0);pa(a)}ea('Array.prototype.includes',function(a){return a?a:function(b,c){var d=this;d instanceof String&&(d=String(d));var e=d.length;c=c||0;for(0>c&&(c=Math.max(c+e,0));c<e;c++){var f=d[c];if(f===b||Object.is(f,b))return!0}return!1}});
214
214
  function ua(a,b){a instanceof String&&(a+='');var c=0,d=!1,e={next:function(){if(!d&&c<a.length){var f=c++;return{value:b(f,a[f]),done:!1}}d=!0;return{done:!0,value:void 0}}};e[Symbol.iterator]=function(){return e};return e}ea('Array.prototype.values',function(a){return a?a:function(){return ua(this,function(b,c){return c})}});
215
215
  ea('Object.fromEntries',function(a){return a?a:function(b){var c={};if(!(Symbol.iterator in b))throw new TypeError(''+b+' is not iterable');b=b[Symbol.iterator].call(b);for(var d=b.next();!d.done;d=b.next()){d=d.value;if(Object(d)!==d)throw new TypeError('iterable for fromEntries should yield objects');c[d[0]]=d[1]}return c}});
216
216
  ea('Promise.prototype.finally',function(a){return a?a:function(b){return this.then(function(c){return Promise.resolve(b()).then(function(){return c})},function(c){return Promise.resolve(b()).then(function(){throw c;})})}});function va(a){if(null==a)throw new TypeError("The 'this' value for String.prototype.padStart must not be null or undefined");return a+''}function wa(a,b){a=void 0!==a?String(a):' ';return 0<b&&a?a.repeat(Math.ceil(b/a.length)).substring(0,b):''}
217
217
  ea('String.prototype.padStart',function(a){return a?a:function(b,c){var d=va(this);return wa(c,b-d.length)+d}});ea('String.prototype.padEnd',function(a){return a?a:function(b,c){var d=va(this);return d+wa(c,b-d.length)}});ea('Promise.allSettled',function(a){function b(d){return{status:'fulfilled',value:d}}function c(d){return{status:'rejected',reason:d}}return a?a:function(d){var e=this;d=Array.from(d,function(f){return e.resolve(f).then(b,c)});return e.all(d)}});
218
218
  ea('Object.entries',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push([d,b[d]]);return c}});ea('Object.values',function(a){return a?a:function(b){var c=[],d;for(d in b)Object.prototype.hasOwnProperty.call(b,d)&&c.push(b[d]);return c}});ea('Array.prototype.flatMap',function(a){return a?a:function(b,c){for(var d=[],e=0;e<this.length;e++){var f=b.call(c,this[e],e,this);Array.isArray(f)?d.push.apply(d,f):d.push(f)}return d}});
219
- ea('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var ya=this||self;function w(a,b){a=a.split('.');let c=ya;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={ke:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.ke())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.ke().olympe=olympe;olympe.tD=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const za=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
220
- (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(za('TRACE',g));console.debug=(...g)=>b(za('DEBUG',g));console.log=(...g)=>c(za('LOG',g));console.info=(...g)=>d(za('INFO',g));console.warn=(...g)=>e(za('WARN',g));console.error=(...g)=>f(za('ERROR',g))})();olympe.Ta={};olympe.Ta.node={};olympe.W={};olympe.W.xf={};olympe.W.xf.Zn=class{process(a){for(const b of Object.keys(a.ve))if(a.vd(b).Xm())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.xf.Zn.ya=[olympe.W.xf.mq];olympe.W.xf.$n=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.vd(e);c(e.Ui(),f);for(const g of Aa(e))c(g.Ui(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.yb&&b(g.V(),f)}const d=new Set(Object.keys(a.ve));for(const e of d)b(e,[])}};olympe.W.xf.$n.ya=[olympe.W.xf.mq];olympe.W.xf.mq=class{process(){}};const Ba=[],Ca=[];function Da(a){const b=a.gb();b.debug('Registering configurations...');b.C++;Ba.forEach(c=>{C(a.H,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});Ea(b);b.debug('done registering')}function Fa(a){const b=a.gb();b.debug('Running run callbacks of container...');b.C++;Ca.forEach(c=>{const d=Ga(a,c.Ui());a.H.debug('Calling run callback '+`for module ${c.C}`);c.F.apply(null,d)});Ea(b);b.debug('done calling run callbacks. DI process completed!')}
221
- olympe.W.fo=class{constructor(){}static C(a,b){Ba.push(new olympe.W.dl(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});Ca.push(new olympe.W.dl(b,c,a))}};olympe.W.config=olympe.W.fo.C;olympe.W.run=olympe.W.fo.F;olympe.W.Qk=class{constructor(){}getValue(){}};function Ha(a,b){let c,d;return null!=(d=null==(c=a.G)?void 0:c.call(a,b))?d:!0}olympe.W.dl=class{constructor(a,b,c){this.F=a;this.J=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.yb(d):d);this.C=null!=b?b:'no name di callback';this.G=null}Ui(){return this.J}};function Ia(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.W.eh.C.Nl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.H.error('Error during instantiation of service '+b),f;}!e.J&&(a.C[b]=d)}return d}function Ga(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.H.C++,f=b[e],d[e]=f instanceof olympe.W.Qk?f.getValue(a):f,Ea(a.H);return d}
222
- olympe.W.eh=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.H=new olympe.W.Fp(c);a=olympe.W.R.kg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}gb(){return this.H}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.W.eh.C={bt:'exception',Nl:'null'};function Ja(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){C(a.H,'Defining service '+b);a.C(b,c,d,!1,!1)}function Ka(a,b,c,...d){C(a.H,'Defining service '+b);a.C(b,c,d,!1,!0)}
219
+ ea('Array.prototype.flat',function(a){return a?a:function(b){b=void 0===b?1:b;for(var c=[],d=0;d<this.length;d++){var e=this[d];Array.isArray(e)&&0<b?(e=Array.prototype.flat.call(e,b-1),c.push.apply(c,e)):c.push(e)}return c}});var ya=this||self;function w(a,b){a=a.split('.');let c=ya;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={je:()=>'object'===typeof window?window:'object'===typeof global?global:self};if('olympe'in olympe.je())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.je().olympe=olympe;olympe.uD=(a,...b)=>{b.forEach(c=>{Object.getOwnPropertyNames(c.prototype).forEach(d=>{'constructor'!==d&&void 0===a.prototype[d]&&(a.prototype[d]=c.prototype[d])})})};const za=(a,b)=>{a={level:a,message:b.map(c=>String(c)).join(' ')};for(const c of b){let d;if(null==(d=c)?0:d.stack)a.stackTrace||(a.stackTrace=''),a.stackTrace+=c.stack}return JSON.stringify(a)};
220
+ (()=>{const a=console.trace,b=console.debug,c=console.log,d=console.info,e=console.warn,f=console.error;console.trace=(...g)=>a(za('TRACE',g));console.debug=(...g)=>b(za('DEBUG',g));console.log=(...g)=>c(za('LOG',g));console.info=(...g)=>d(za('INFO',g));console.warn=(...g)=>e(za('WARN',g));console.error=(...g)=>f(za('ERROR',g))})();olympe.Ta={};olympe.Ta.node={};olympe.W={};olympe.W.yf={};olympe.W.yf.Zn=class{process(a){for(const b of Object.keys(a.ue))if(a.vd(b).Xm())throw Error('Service "'+b+'" is defined as abstract and needs to be overridden');}};olympe.W.yf.Zn.ya=[olympe.W.yf.nq];olympe.W.yf.$n=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.vd(e);c(e.Ui(),f);for(const g of Aa(e))c(g.Ui(),f)}}function c(e,f){for(const g of e)g instanceof olympe.W.yb&&b(g.V(),f)}const d=new Set(Object.keys(a.ue));for(const e of d)b(e,[])}};olympe.W.yf.$n.ya=[olympe.W.yf.nq];olympe.W.yf.nq=class{process(){}};const Ba=[],Ca=[];function Da(a){const b=a.hb();b.debug('Registering configurations...');b.C++;Ba.forEach(c=>{C(a.H,'Registering configure callback '+(c.C?'for module '+c.C:''));a.F.push(c.F)});Ea(b);b.debug('done registering')}function Fa(a){const b=a.hb();b.debug('Running run callbacks of container...');b.C++;Ca.forEach(c=>{const d=Ga(a,c.Ui());a.H.debug('Calling run callback '+`for module ${c.C}`);c.F.apply(null,d)});Ea(b);b.debug('done calling run callbacks. DI process completed!')}
221
+ olympe.W.fo=class{constructor(){}static C(a,b){Ba.push(new olympe.W.dl(a,b))}static F(a,b,c){a.forEach(d=>{if(null===d||void 0===d)throw Error('Cannot proceed - DI configuration error. '+(c?`Run callback "${c}"`:'A run callback')+' cannot have a null or undefined dependency');});Ca.push(new olympe.W.dl(b,c,a))}};olympe.W.config=olympe.W.fo.C;olympe.W.run=olympe.W.fo.F;olympe.W.Qk=class{constructor(){}getValue(){}};function Ha(a,b){let c,d;return null!=(d=null==(c=a.G)?void 0:c.call(a,b))?d:!0}olympe.W.dl=class{constructor(a,b,c){this.F=a;this.K=(null!=c?c:[]).map(d=>'string'===typeof d?new olympe.W.yb(d):d);this.C=null!=b?b:'no name di callback';this.G=null}Ui(){return this.K}};function Ia(a,b,c){let d=a.C[b];if(void 0===d){const e=a.F[b];if(void 0===e){if(c===olympe.W.eh.C.Nl)return null;throw Error('Service "'+b+'" not found');}try{d=e.instantiate(a)}catch(f){throw a.H.error('Error during instantiation of service '+b),f;}!e.K&&(a.C[b]=d)}return d}function Ga(a,b){const c=b.length,d=Array(c);let e,f;for(e=0;e<c;e++)a.H.C++,f=b[e],d[e]=f instanceof olympe.W.Qk?f.getValue(a):f,Ea(a.H);return d}
222
+ olympe.W.eh=class{constructor(a,b,c=2){this.F=a;this.parameters=b;this.C=Object.create(null);this.H=new olympe.W.Gp(c);a=olympe.W.R.kg;if(void 0!==this.C[a])throw Error('Service "'+a+'" has already been instantiated');this.C[a]=this}hb(){return this.H}getParameter(a){return this.parameters[a.toLowerCase()]}};olympe.W.eh.C={dt:'exception',Nl:'null'};function Ja(a,b,c){function d(f,g){let h,k,l;for(h in f)Object.prototype.hasOwnProperty.call(f,h)&&(k=f[h],l=g.concat((h.startsWith('#')?h.substring(1):h).toLowerCase()),'object'!==typeof k||null===k||h.startsWith('#')?e[l.join('.')]=k:d(k,l))}const e=a.parameters;d(b,c?[c]:[])}function D(a,b,c,...d){C(a.H,'Defining service '+b);a.C(b,c,d,!1,!1)}function Ka(a,b,c,...d){C(a.H,'Defining service '+b);a.C(b,c,d,!1,!0)}
223
223
  function E(a,b,c,d,e=!1){C(a.H,'Defining service (as a factory) '+b);a.C(b,d,c,!0,e)}function La(a,b,c,d=!1){C(a.H,'Defining service alias '+b);a.C(b,e=>e,[c],!0,d)}function Ma(a,b){C(a.H,'Defining abstract service '+b);a.C(b).G=!0}function Na(a,b,c){a.parameters[b.toLowerCase()]=c}function F(a,b,c){b=b.toLowerCase();Object.prototype.hasOwnProperty.call(a.parameters,b)||(a.parameters[b]=c)}
224
- olympe.W.Ss=class{constructor(a){var b=Oa,c=Qa;this.ve=Object.create(null);this.parameters=Object.create(null);this.J=[new olympe.W.xf.Zn,new olympe.W.xf.$n];this.F=[];b&&Ja(this,b);c&&Ja(this,c,'version');a&&Ja(this,a);a=this.getParameter(olympe.W.U.gu);this.G=void 0!==a?a:3;this.H=new olympe.W.Fp(this.G)}gb(){return this.H}C(a,b,c,d,e){const f=a instanceof olympe.W.yb?a.V():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!`);
225
- var g=this.ve[f];g.id=g.id+'!!'+ ++olympe.W.nl.C;g.J=!0;g=g.id;c[h]=g;this.ve[g]=this.ve[f]}}this.ve[f]=new olympe.W.nl(b,c,d||!1,f);return this.ve[f]}vd(a){const b=this.ve[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.H.debug('Calling '+a.length+' configure callbacks');this.H.C++;a.forEach(b=>{C(this.H,'Calling callback');this.H.C++;b(this);Ea(this.H)});Ea(this.H);this.H.debug('Configuration summary: '+
226
- Object.keys(this.ve).length+' definitions');this.H.debug('Compiling...');this.H.C++;this.J.forEach((b,c)=>{this.H.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ea(this.H);this.H.debug('Compilation done, returning container');return new olympe.W.eh(this.ve,this.parameters,this.G)}};function Aa(a){let b,c;return null!=(c=null==(b=a.C)?void 0:b.values())?c:[]}
227
- olympe.W.nl=class{constructor(a,b,c,d){this.O=a||null;this.T=!!c;this.F=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.yb(e):e);this.G=!1;this.C=null;this.id=null!=d?d:'';this.J=!1}V(){return this.id}instantiate(a){const b=a.gb();b.debug('Resolving arguments for '+this.id);const c=this.O;let d=Ga(a,this.F);const e=()=>{if(this.T)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.Og().run(()=>e()):e();let g;if(0<(null==
224
+ olympe.W.Ts=class{constructor(a){var b=Oa,c=Qa;this.ue=Object.create(null);this.parameters=Object.create(null);this.K=[new olympe.W.yf.Zn,new olympe.W.yf.$n];this.F=[];b&&Ja(this,b);c&&Ja(this,c,'version');a&&Ja(this,a);a=this.getParameter(olympe.W.U.hu);this.G=void 0!==a?a:3;this.H=new olympe.W.Gp(this.G)}hb(){return this.H}C(a,b,c,d,e){const f=a instanceof olympe.W.yb?a.V():a;if(3<=arguments.length&&c){const h=c.indexOf(f);if(-1!==h){if(void 0===this.ue[f])throw Error(`ContainerBuilder.define: Service ${f} references itself and is not an override definition!`);
225
+ var g=this.ue[f];g.id=g.id+'!!'+ ++olympe.W.nl.C;g.K=!0;g=g.id;c[h]=g;this.ue[g]=this.ue[f]}}this.ue[f]=new olympe.W.nl(b,c,d||!1,f);return this.ue[f]}vd(a){const b=this.ue[a];if(void 0===b)throw Error(`DI Error: Definition ${a} was not found`);return b}getParameter(a){return this.parameters[a.toLowerCase()]}compile(){const a=this.F;this.H.debug('Calling '+a.length+' configure callbacks');this.H.C++;a.forEach(b=>{C(this.H,'Calling callback');this.H.C++;b(this);Ea(this.H)});Ea(this.H);this.H.debug('Configuration summary: '+
226
+ Object.keys(this.ue).length+' definitions');this.H.debug('Compiling...');this.H.C++;this.K.forEach((b,c)=>{this.H.debug('running compilation pass '+(c+1)+': '+b.constructor.name);b.process(this)});Ea(this.H);this.H.debug('Compilation done, returning container');return new olympe.W.eh(this.ue,this.parameters,this.G)}};function Aa(a){let b,c;return null!=(c=null==(b=a.C)?void 0:b.values())?c:[]}
227
+ olympe.W.nl=class{constructor(a,b,c,d){this.O=a||null;this.T=!!c;this.F=(null!=b?b:[]).map(e=>'string'===typeof e?new olympe.W.yb(e):e);this.G=!1;this.C=null;this.id=null!=d?d:'';this.K=!1}V(){return this.id}instantiate(a){const b=a.hb();b.debug('Resolving arguments for '+this.id);const c=this.O;let d=Ga(a,this.F);const e=()=>{if(this.T)return c.apply(null,d);d.unshift(null);return new (c.bind.apply(c,d))};C(b,'Instantiating '+this.id);const f=olympe.D?olympe.D.Og().run(()=>e()):e();let g;if(0<(null==
228
228
  (g=this.C)?void 0:g.size)){b.C++;C(b,'Calling configuration callbacks:');for(const h of this.C.values())b.C++,C(b,'Check if need to call additional configuration callback '+h.C),Ha(h,f)?(C(b,'Calling additional configuration callback '+h.C),d=Ga(a,h.Ui()),d.push(f),h.F.apply(null,d)):C(b,'Will not call additional configuration callback '+h.C+'predicate has returned false'),Ea(b);Ea(b)}C(b,'Done instantiating '+this.id);return f}Ui(){return this.F}Xm(){return this.G}config(a,b,c,d,e){null===this.C&&
229
- (this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.dl(c,e,b);b.G=d;g.call(f,a,b)}};olympe.W.nl.C=0;function Ea(a){0<a.C&&a.C--}function C(a,b){1>=a.F&&Ra(a,'log','DI: '+b)}function Ra(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.W.Fp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Ra(this,'log','DI: '+a)}info(a){3>=this.F&&Ra(this,'info','DI: '+a)}warn(a){4>=this.F&&Ra(this,'warn','DI: '+a)}error(a){5>=this.F&&Ra(this,'error','DI: '+a)}};olympe.W.ja=class extends olympe.W.Qk{constructor(a){super();this.id=a}V(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.yb=class extends olympe.W.Qk{constructor(a,b){super();this.id=a;this.C=b||olympe.W.eh.C.bt}V(){return this.id}getValue(a){return Ia(a,this.id,this.C)}};olympe.W.R={kg:'di.Container',eB:'di.PublicContainer'};olympe.W.U={gu:'logging.di'};olympe.W.run([olympe.W.R.kg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.ke().getConfig=b=>a.getParameter(b);olympe.ke().getConfigNames=()=>Object.keys(a.parameters)});olympe.Y={};olympe.Y.rp=class{constructor(a){this.id=a||olympe.Y.rp.C++}Ga(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.rp.C=0;olympe.Y.KA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Y.ph=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.Y.ph.F=function(a){return new olympe.Y.ph(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.Y.ph.C=function(){return new olympe.Y.ph(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.ph.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.ph.prototype.get=function(a,b){return this.values[5*a+b]};function Sa(a){return(new TextEncoder).encode(a)}function Ta(a,b){return a.C(Sa(b))}function Ua(a){return(new TextDecoder('utf8')).decode(a)}
230
- olympe.Y.Wk=class{F(){}C(){}J(a){return v(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return Sa(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.Y.stream.Bg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}G(){}};
231
- olympe.Y.vr=a=>a.replace('+','-').replace('/','_');olympe.Y.Yv=a=>a.replace('-','+').replace('_','/');function Va(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Va(a);else{let d;null==(d=a.G)||d.call(a)}},a.J)}function Wa(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Xa(a,b){a.F=b;return a}
232
- olympe.Y.pm=class{constructor(a,b=a/2){this.timeout=a;this.J=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Va(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Ya(a,b){a.F=b;return a}function Za(a,b){a.C.G=b}
233
- olympe.Y.Ah=class{constructor(a){this.C=Xa(new olympe.Y.pm(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function $a(a,b){a.T.push(b)}function ab(a,b){a.Z.push(b)}function bb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>bb(a,d)):c='N/A';return c}function cb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.F};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=bb(a,g);a.G.push(b)}
234
- olympe.Y.Mu=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.J=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function db(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.Y.operators={TD(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.Y.Promise={};olympe.Y.Promise.nk=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.qn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.Y.promise={};function eb(a){if(0===a.size())a.F.next(!1);else if(a.G()){a.C++;var b=fb(a);b&&b.F.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.C(c)}).finally(()=>{a.C--;0===a.size()&&a.F.next(!1);eb(a)})}}function gb(a,b){return new Promise((c,d)=>{a.Xa.push(new olympe.Y.promise.lv(c,d,b));eb(a)})}function fb(a){a.F.next(!0);let b;return null!=(b=a.Xa.shift())?b:null}
235
- olympe.Y.promise.im=class{constructor(){this.Xa=[];this.F=new rxjs.BehaviorSubject(!1);this.C=0}G(){return 0===this.C}clear(){for(;0<this.Xa.length;)this.Xa.shift().C(Error('Canceled by a clearStack'));eb(this)}size(){return this.Xa.length}};olympe.Y.promise.lv=class{constructor(a,b,c){this.resolve=a;this.C=b;this.F=c}};olympe.Y.promise.mv=class extends olympe.Y.promise.im{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.aj=a}G(){return this.C<this.aj}};olympe.Y.promise.zC=class{constructor(a,...b){this.G=a;this.parameters=b;this.C=this.F=null;this.promise=new Promise((c,d)=>{this.F=c;this.C=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
229
+ (this.C=new Map);var f=this.C,g=f.set;b=new olympe.W.dl(c,e,b);b.G=d;g.call(f,a,b)}};olympe.W.nl.C=0;function Ea(a){0<a.C&&a.C--}function C(a,b){1>=a.F&&Ra(a,'log','DI: '+b)}function Ra(a,b,c){if(console&&console[b]){var d='';for(let e=0;e<a.C;e++)d+=' ';console[b](d+c)}}olympe.W.Gp=class{constructor(a){this.F=a;this.C=0}debug(a){2>=this.F&&Ra(this,'log','DI: '+a)}info(a){3>=this.F&&Ra(this,'info','DI: '+a)}warn(a){4>=this.F&&Ra(this,'warn','DI: '+a)}error(a){5>=this.F&&Ra(this,'error','DI: '+a)}};olympe.W.ja=class extends olympe.W.Qk{constructor(a){super();this.id=a}V(){return this.id}getValue(a){return a.getParameter(this.id)}};olympe.W.yb=class extends olympe.W.Qk{constructor(a,b){super();this.id=a;this.C=b||olympe.W.eh.C.dt}V(){return this.id}getValue(a){return Ia(a,this.id,this.C)}};olympe.W.R={kg:'di.Container',fB:'di.PublicContainer'};olympe.W.U={hu:'logging.di'};olympe.W.run([olympe.W.R.kg],a=>{olympe.W.getParameter=b=>a.getParameter(b);olympe.je().getConfig=b=>a.getParameter(b);olympe.je().getConfigNames=()=>Object.keys(a.parameters)});olympe.Y={};olympe.Y.sp=class{constructor(a){this.id=a||olympe.Y.sp.C++}Ga(a){return a?this.id===a.id:!1}toJSON(){return this.id.toString()}toString(){return this.id.toString()}};olympe.Y.sp.C=0;olympe.Y.LA=class{constructor(a,b,c,d,e,f){this.C=[a||0,b||0,0,c||0,d||0,0,e||0,f||0,1]}set(a,b,c){this.C[3*a+b]=c}get(a,b){return this.C[3*a+b]}};olympe.Y.ph=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.Y.ph.F=function(a){return new olympe.Y.ph(.213+.787*a,.715-.715*a,.072-.072*a,.213-.213*a,.715+.285*a,.072-.072*a,.213-.213*a,.715-.715*a,.072+.928*a,0,0,0,1)};olympe.Y.ph.C=function(){return new olympe.Y.ph(0,0,0,0,0,0,0,0,0,.2125,.7154,.0721,0)};olympe.Y.ph.prototype.set=function(a,b,c){this.values[5*a+b]=c};olympe.Y.ph.prototype.get=function(a,b){return this.values[5*a+b]};function Sa(a){return(new TextEncoder).encode(a)}function Ta(a,b){return a.C(Sa(b))}function Ua(a){return(new TextDecoder('utf8')).decode(a)}
230
+ olympe.Y.Wk=class{F(){}C(){}K(a){return v(function*(){if(a instanceof ArrayBuffer)return new Uint8Array(a);if(a instanceof Uint8Array)return a;if('string'===typeof a)return Sa(a);if(a instanceof Blob)return new Uint8Array(yield a.arrayBuffer());if(a instanceof olympe.Y.stream.Bg){const b=[];for(const c=ha(a);;){const d=yield c.next();if(d.done)break;b.push(...d.value)}return new Uint8Array(b)}throw Error('Unsupported value type for binary conversion.');})}G(){}};
231
+ olympe.Y.wr=a=>a.replace('+','-').replace('/','_');olympe.Y.Zv=a=>a.replace('-','+').replace('_','/');function Va(a){a.C=setTimeout(()=>{const b=Date.now(),c=a.timeout;for(const [d,e]of a.values)b-e>c&&(a.delete(d),a.F&&a.F(d));if(0<a.values.size)Va(a);else{let d;null==(d=a.G)||d.call(a)}},a.K)}function Wa(a,b){return a.values.has(b)?(a.values.set(b,Date.now()),!0):!1}function Xa(a,b){a.F=b;return a}
232
+ olympe.Y.pm=class{constructor(a,b=a/2){this.timeout=a;this.K=b;this.values=new Map;this.G=this.F=this.C=null}add(a){this.values.set(a,Date.now());null===this.C&&Va(this)}has(a){return this.values.has(a)}forEach(a){this.values.forEach((b,c)=>a(c))}delete(a){a=this.values.delete(a);if(0===this.values.size){this.C&&clearTimeout(this.C);this.C=null;let b;null==(b=this.G)||b.call(this)}return a}clear(){this.C&&clearTimeout(this.C);this.C=null;this.values.clear();return this}};function Ya(a,b){a.F=b;return a}function Za(a,b){a.C.G=b}
233
+ olympe.Y.Bh=class{constructor(a){this.C=Xa(new olympe.Y.pm(a,void 0),b=>{const c=this.values.get(b);this.values.delete(b);let d;null==(d=this.F)||d.call(this,b,c)});this.values=new Map;this.F=null}set(a,b){this.values.set(a,b);this.C.add(a);return this}has(a){return this.values.has(a)}get(a){return this.values.get(a)}forEach(a){this.values.forEach((b,c)=>a(b,c))}delete(a){this.values.delete(a);return this.C.delete(a)}clear(){this.C.clear();this.values.clear();return this}};function $a(a,b){a.T.push(b)}function ab(a,b){a.Z.push(b)}function bb(a,b){let c;'object'!==typeof b&&'function'!==typeof b?c=b:b instanceof olympe.dc.CloudObject?c=b.toJSON():Array.isArray(b)?c=b.map(d=>bb(a,d)):c='N/A';return c}function cb(a,b,c,d){b={cat:b,epoch:null!=d?d:performance.now()-a.F};let e;for(const [f,g]of null!=(e=c)?e:[])b[f]=bb(a,g);a.G.push(b)}
234
+ olympe.Y.Nu=class{constructor(){this.G=[];this.T=[];this.Z=[];this.O=new Map;this.K=new Map;this.C=!1;this.F=null}start(){this.C||(this.F||(this.F=performance.now()),this.C=!0,this.T.forEach(a=>a()))}stop(){this.C&&(this.Z.forEach(a=>a()),this.C=!1)}};function db(a,b,c=5E3){return rxjs.operators.retry({resetOnSuccess:!0,delay:(d,e)=>{if(d instanceof a){const f=Math.round(Math.random()*(e+1)*c);return rxjs.timer(f).pipe(rxjs.operators.tap(()=>null==b?void 0:b(d,f)))}return rxjs.throwError(()=>d)}})}olympe.Y.operators={UD(a,b=0){return c=>c.pipe(rxjs.operators.map((d,e)=>{e===b&&a(d);return d}))}};olympe.Y.Promise={};olympe.Y.Promise.nk=function(a,b){let c=null;return(...d)=>new Promise((e,f)=>{clearTimeout(c);c=setTimeout(()=>v(function*(){try{const g=yield a(...d);e(g)}catch(g){f(g)}}),b)})};olympe.Y.Promise.qn=function(a,b,c='Promise timeout'){return new Promise((d,e)=>{const f=setTimeout(()=>{e(Error(c))},b);a.then(g=>{clearTimeout(f);d(g)}).catch(g=>{clearTimeout(f);e(g)})})};olympe.Y.promise={};function eb(a){if(0===a.size())a.F.next(!1);else if(a.G()){a.C++;var b=fb(a);b&&b.F.call(a).then(c=>{b.resolve(c)}).catch(c=>{b.C(c)}).finally(()=>{a.C--;0===a.size()&&a.F.next(!1);eb(a)})}}function gb(a,b){return new Promise((c,d)=>{a.Xa.push(new olympe.Y.promise.mv(c,d,b));eb(a)})}function fb(a){a.F.next(!0);let b;return null!=(b=a.Xa.shift())?b:null}
235
+ olympe.Y.promise.im=class{constructor(){this.Xa=[];this.F=new rxjs.BehaviorSubject(!1);this.C=0}G(){return 0===this.C}clear(){for(;0<this.Xa.length;)this.Xa.shift().C(Error('Canceled by a clearStack'));eb(this)}size(){return this.Xa.length}};olympe.Y.promise.mv=class{constructor(a,b,c){this.resolve=a;this.C=b;this.F=c}};olympe.Y.promise.nv=class extends olympe.Y.promise.im{constructor(a){super();if('number'!==typeof a||0>=a)throw Error('StackWindow with an invalid concurrentLimit. It must be a number > 0 for the stack to work properly');this.aj=a}G(){return this.C<this.aj}};olympe.Y.promise.AC=class{constructor(a,...b){this.G=a;this.parameters=b;this.C=this.F=null;this.promise=new Promise((c,d)=>{this.F=c;this.C=d});this.start()}then(a){return this.promise.then(a)}catch(a){return this.promise.catch(a)}finally(a){return this.promise.finally(a)}start(){'undefined'!==typeof Worker?setTimeout(()=>{const a=URL.createObjectURL(new Blob([`
236
236
  function onFullfilledCallback(data) {
237
237
  self.postMessage({ type: "done", data, });
238
238
  self.close();
@@ -243,7 +243,7 @@ olympe.Y.promise.im=class{constructor(){this.Xa=[];this.F=new rxjs.BehaviorSubje
243
243
  }
244
244
  self.onmessage = ({ data: { params } }) => {
245
245
  (${this.G.toString()})(onFullfilledCallback, onRejectedCallback, ...(params ?? []));
246
- };`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);if('done'===e){let f;null==(f=this.F)||f.call(this,d)}else{let f;null==(f=this.C)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.G(this.F,this.C,...this.parameters)}};olympe.Y.stream={};olympe.Y.stream.Bg=class{constructor(){this.buffer=[];this.J=this.C=!1;this.error=this.F=null}[Symbol.asyncIterator](){const a=this;return new oa(function*(){if(a.J)throw Error('This stream is already being read');for(a.J=!0;!a.error&&(!a.C||0<a.buffer.length);)0===a.buffer.length&&(yield new ja(2,new Promise(b=>{a.F=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ja(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return v(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
246
+ };`])),b=new Worker(a);b.addEventListener('message',c=>{const {data:d,type:e}=c.data;URL.revokeObjectURL(a);if('done'===e){let f;null==(f=this.F)||f.call(this,d)}else{let f;null==(f=this.C)||f.call(this,d)}});b.postMessage({params:this.parameters})},0):this.G(this.F,this.C,...this.parameters)}};olympe.Y.stream={};olympe.Y.stream.Bg=class{constructor(){this.buffer=[];this.K=this.C=!1;this.error=this.F=null}[Symbol.asyncIterator](){const a=this;return new oa(function*(){if(a.K)throw Error('This stream is already being read');for(a.K=!0;!a.error&&(!a.C||0<a.buffer.length);)0===a.buffer.length&&(yield new ja(2,new Promise(b=>{a.F=()=>b()}))),!a.error&&0<a.buffer.length&&(yield new ja(0,a.buffer.shift()));if(a.error)throw a.error;}())}write(a){const b=this;return v(function*(){if(null===a||void 0===a)throw Error('Try to stream null or undefined');
247
247
  if(b.C)throw Error('Cannot write to a completed stream');b.buffer.push(a);let c;null==(c=b.F)||c.call(b)})}G(a){(()=>{const b=this;return v(function*(){try{for(const c=ha(b);;){const d=yield c.next();if(d.done)break;yield a.write(d.value)}a.complete()}catch(c){a.throw(c)}})})()}throw(a){this.C||(this.error=a,this.complete())}complete(){if(!this.C){this.C=!0;let a;null==(a=this.F)||a.call(this)}}};olympe.Y.stream.Bg.ya=[olympe.Y.stream.ReadableStream,olympe.Y.stream.WritableStream];olympe.Y.stream.ReadableStream=class{[Symbol.asyncIterator](){return new oa(function*(){}())}G(){}};olympe.Y.stream.WritableStream=class{write(){return v(function*(){})}throw(){}complete(){}};function hb(a,b){return a+b&4294967295}
248
248
  function ib(a,b){let c=a[0],d=a[1],e=a[2],f=a[3];c=G(c,d,e,f,b[0],7,-680876936);f=G(f,c,d,e,b[1],12,-389564586);e=G(e,f,c,d,b[2],17,606105819);d=G(d,e,f,c,b[3],22,-1044525330);c=G(c,d,e,f,b[4],7,-176418897);f=G(f,c,d,e,b[5],12,1200080426);e=G(e,f,c,d,b[6],17,-1473231341);d=G(d,e,f,c,b[7],22,-45705983);c=G(c,d,e,f,b[8],7,1770035416);f=G(f,c,d,e,b[9],12,-1958414417);e=G(e,f,c,d,b[10],17,-42063);d=G(d,e,f,c,b[11],22,-1990404162);c=G(c,d,e,f,b[12],7,1804603682);f=G(f,c,d,e,b[13],12,-40341101);e=G(e,f,
249
249
  c,d,b[14],17,-1502002290);d=G(d,e,f,c,b[15],22,1236535329);c=H(c,d,e,f,b[1],5,-165796510);f=H(f,c,d,e,b[6],9,-1069501632);e=H(e,f,c,d,b[11],14,643717713);d=H(d,e,f,c,b[0],20,-373897302);c=H(c,d,e,f,b[5],5,-701558691);f=H(f,c,d,e,b[10],9,38016083);e=H(e,f,c,d,b[15],14,-660478335);d=H(d,e,f,c,b[4],20,-405537848);c=H(c,d,e,f,b[9],5,568446438);f=H(f,c,d,e,b[14],9,-1019803690);e=H(e,f,c,d,b[3],14,-187363961);d=H(d,e,f,c,b[8],20,1163531501);c=H(c,d,e,f,b[13],5,-1444681467);f=H(f,c,d,e,b[2],9,-51403784);
@@ -251,883 +251,885 @@ e=H(e,f,c,d,b[7],14,1735328473);d=H(d,e,f,c,b[12],20,-1926607734);c=I(d^e^f,c,d,
251
251
  f=I(c^d^e,f,c,b[12],11,-421815835);e=I(f^c^d,e,f,b[15],16,530742520);d=I(e^f^c,d,e,b[2],23,-995338651);c=J(c,d,e,f,b[0],6,-198630844);f=J(f,c,d,e,b[7],10,1126891415);e=J(e,f,c,d,b[14],15,-1416354905);d=J(d,e,f,c,b[5],21,-57434055);c=J(c,d,e,f,b[12],6,1700485571);f=J(f,c,d,e,b[3],10,-1894986606);e=J(e,f,c,d,b[10],15,-1051523);d=J(d,e,f,c,b[1],21,-2054922799);c=J(c,d,e,f,b[8],6,1873313359);f=J(f,c,d,e,b[15],10,-30611744);e=J(e,f,c,d,b[6],15,-1560198380);d=J(d,e,f,c,b[13],21,1309151649);c=J(c,d,e,f,
252
252
  b[4],6,-145523070);f=J(f,c,d,e,b[11],10,-1120210379);e=J(e,f,c,d,b[2],15,718787259);d=J(d,e,f,c,b[9],21,-343485551);a[0]=hb(c,a[0]);a[1]=hb(d,a[1]);a[2]=hb(e,a[2]);a[3]=hb(f,a[3])}function I(a,b,c,d,e,f){b=hb(hb(b,a),hb(d,f));return hb(b<<e|b>>>32-e,c)}function G(a,b,c,d,e,f,g){return I(b&c|~b&d,a,b,e,f,g)}function H(a,b,c,d,e,f,g){return I(b&d|c&~d,a,b,e,f,g)}function J(a,b,c,d,e,f,g){return I(c^(b|~d),a,b,e,f,g)}
253
253
  function jb(a,b=32){const c='0123456789abcdef'.split('');var d=a,e=d.length;a=[1732584193,-271733879,-1732584194,271733878];var f;for(f=64;f<=d.length;f+=64){var g=d.substring(f-64,f),h=[];for(let k=0;64>k;k+=4)h[k>>2]=g.charCodeAt(k)+(g.charCodeAt(k+1)<<8)+(g.charCodeAt(k+2)<<16)+(g.charCodeAt(k+3)<<24);ib(a,h)}d=d.substring(f-64);g=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(f=0;f<d.length;f++)g[f>>2]|=d.charCodeAt(f)<<(f%4<<3);g[f>>2]|=128<<(f%4<<3);if(55<f)for(ib(a,g),f=0;16>f;f++)g[f]=0;g[14]=8*e;
254
- ib(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==jb('hello')&&(hb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Y.xb=jb;function kb(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function lb(){var a=Math.random();return kb((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const mb=Math.pow(2,32)-1;olympe.Y.Mc=function(){return lb()};olympe.Y.zf=function(){return lb()};olympe.Y.FD=function(a,b=1){const c=a.substr(12,a.length-12);return kb(parseInt(a.substr(0,12),16)+b)+c};
255
- olympe.Y.ED=function(a){return kb(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let nb=0,ob=0;olympe.Y.vw=function(){var a=(new Date).getTime();a<=nb?4294967295===ob?(ob=Math.floor(Math.random()/4*mb),nb+=1):ob=Math.floor(ob+(4294967295-ob)/2):(ob=Math.floor(Math.random()/4*mb),nb=a);a='00000000'+ob.toString(16);return kb(nb)+a.substr(a.length-8,8)};olympe.Y.UD=function(){for(let a=0;1E4>a;a++)console.log(olympe.Y.vw())};
256
- olympe.Y.Nh=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Y.zD=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.Y.vD=function(a,b){return(b?b:'UI')+'-'+a};
257
- olympe.Y.oy=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
258
- r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,dD:g||null,ns:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,wD:f||null,parameters:b}};olympe.Y.OD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
259
- olympe.Y.RD=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.Y.DD=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};olympe.Y.bn=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Y.bn(a[c],d):a[c]=d}};
260
- olympe.Y.Fe=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Y.bn(d,e);b(`conf.d/${a}`,f=>{olympe.Y.bn(d,f);c(d)})})};olympe.Y.cD=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Rm(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Y.ju=class{constructor(a,b){this.start=a;this.end=b}};olympe.Y.ju.C={yA:'left',nB:'right',az:'bottom',xC:'top'};function pb(a){return`${a.C}.${a.F}.${a.G}`}
261
- olympe.Y.vf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=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.Y.vf.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Y.vf.C:new olympe.Y.vf(b,c,d,a[4])}xk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}gj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
262
- a.G}Ga(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.J?`-${this.J}`:'')}};olympe.Y.vf.C=new olympe.Y.vf(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={jg:'utils.binaryConverter',As:'utils.base64Converter',Sf:'utils.Profiler'};olympe.W.config(a=>{Ma(a,olympe.Y.R.jg);La(a,olympe.Y.R.As,olympe.Y.R.jg,!0);D(a,olympe.Y.R.Sf,olympe.Y.Mu)},'Utils services');olympe.W.run([olympe.Y.R.jg,olympe.Y.R.Sf],(a,b)=>{olympe.Y.Ye=()=>a;olympe.ke().isProfilerEnabled=()=>b.C;olympe.ke().startProfiler=()=>b.start();olympe.ke().stopProfiler=()=>b.stop();olympe.ke().getProfilerEvents=()=>({events:b.G,names:Object.fromEntries(b.O.entries()),models:Object.fromEntries(b.J.entries())})});olympe.ma={};olympe.ma.Hb=class{na(){}Z(){}J(){}C(){}ka(){}O(){}ua(){}aa(){}ea(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ma.Hb.prototype.fatal=olympe.ma.Hb.prototype.fatal;olympe.ma.Hb.prototype.error=olympe.ma.Hb.prototype.error;olympe.ma.Hb.prototype.warn=olympe.ma.Hb.prototype.warn;olympe.ma.Hb.prototype.info=olympe.ma.Hb.prototype.info;olympe.ma.Hb.prototype.log=olympe.ma.Hb.prototype.log;olympe.ma.Hb.prototype.debug=olympe.ma.Hb.prototype.debug;olympe.ma.Hb.prototype.trace=olympe.ma.Hb.prototype.trace;
263
- olympe.ma.Hb.C={tv:0,Mf:1,fu:2,lp:3,Iv:4,zb:5,ft:6,ti:7};olympe.ma.Hb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ma.Sa=class{Wc(){}};olympe.ma.qe={};function qb(a,b,c,d){a.Fa[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.T.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.T.values())f(e,c,b,...d)}}
264
- olympe.ma.qe.Hb=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.T=new Map;this.Fa=console}na(){return this.name}Z(){return this.F}J(){return this.F<=olympe.ma.Hb.C.tv}C(){return this.F<=olympe.ma.Hb.C.Mf}O(){return this.F<=olympe.ma.Hb.C.fu}ka(){return this.F<=olympe.ma.Hb.C.lp}ua(){return this.F<=olympe.ma.Hb.C.Iv}aa(){return this.F<=olympe.ma.Hb.C.zb}ea(){return this.F<=olympe.ma.Hb.C.ft}trace(...a){this.J()&&qb(this,'trace',this.G,a)}debug(...a){this.C()&&qb(this,'debug',
265
- this.G,a)}log(...a){this.O()&&qb(this,'log',this.G,a)}info(...a){this.ka()&&qb(this,'info',this.G,a)}warn(...a){this.ua()&&qb(this,'warn',this.G,a)}error(...a){this.aa()&&qb(this,'error',this.G,a)}fatal(...a){this.ea()&&qb(this,'error',this.G,a)}};olympe.ma.qe.Hb.ya=[olympe.ma.Hb];olympe.ma.qe.Sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.H=this.Wc('logging');this.H.info('Logging initialized, global log level is '+olympe.ma.Hb.F[b])}Wc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ma.U.Gs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ma.U.dv}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
266
- (d=!0===this.C.getParameter(c));b=new olympe.ma.qe.Hb(a,b,d);this.channels.set(a,b)}return b}};olympe.ma.qe.Sa.ya=[olympe.ma.Sa];olympe.ma.R={Ea:'logging.Manager'};olympe.ma.U={Vo:'logging',Wo:'logging.showLogLevel',Gs:'logging',dv:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ma.U.Vo,olympe.ma.Hb.C.lp);F(a,olympe.ma.U.Wo,!0);Ka(a,olympe.ma.R.Ea,olympe.ma.qe.Sa,olympe.W.R.kg,new olympe.W.ja(olympe.ma.U.Vo),new olympe.W.ja(olympe.ma.U.Wo))},'olympe.logging');olympe.W.run([olympe.ma.R.Ea],a=>{olympe.ma.gb=b=>a.Wc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.U={Lp:'df.nodeCreationThreshold'};const rb=[];function sb(){}function tb(){}olympe.D.K=class a{constructor(b,c,d){this.C=void 0===b?sb:b;this.F=void 0===c?rb:c;this.Z=d}static J(){var b=[];return void 0===b||0===b.length?olympe.D.K.aa:new a(tb,b)}J(){return this.C?this.C():void 0}G(){return this.F?this.F:rb}O(){return null===this.C&&null===this.F}T(){return this.C===tb}};olympe.D.K.Z=new olympe.D.K;olympe.D.K.C=new olympe.D.K(null,null);olympe.D.K.aa=new olympe.D.K(tb);olympe.D.K.G=new olympe.D.K(()=>olympe.D.ba);
267
- olympe.D.K.F=new olympe.D.K(()=>olympe.D.Oa);olympe.D.K.O=new olympe.D.K(()=>olympe.D.fa);olympe.D.K.T=new olympe.D.K(()=>olympe.D.Tb);olympe.D.ih=class{V(){return''}ad(){return''}destroy(){}eb(){return!1}od(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}yf(){}Bc(){}Tc(){}mk(){}ka(){}onDestroy(){return''}Hf(){}Z(){return''}De(){}};olympe.D.ih.prototype.offDestroy=olympe.D.ih.prototype.Hf;olympe.D.ih.prototype.onDestroy=olympe.D.ih.prototype.onDestroy;let ub=0;olympe.W.run([new olympe.W.ja(olympe.D.U.Lp)],()=>{});
268
- olympe.D.Zb=class{constructor(a='SimpleContext',b){++ub;this.kb=new Map;this.ab=new Map;this.Fa=new Map;this.bc=0;this.name=a;this.id=String(ub);this.J=this.vb=!1;(this.aa=void 0===b?olympe.D.$a():b)&&this.aa.Bc(this);this.debug=!1}V(){return this.id}ad(){return this.name}run(a,...b){if(!this.vb){var c=olympe.D.js(this);a=a(...b);c&&olympe.D.js(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.vb&&!this.J){this.J=!0;this.ka();for(const a of this.ab.keys())this.ab.has(a)&&this.ab.get(a)();
269
- this.ab.clear();this.Fa.clear();this.aa&&(this.aa.Tc(this,!1),this.aa=null);this.vb=!0;this.J=!1;this.ka()}}eb(){return this.vb}od(){return this.J}Bc(a){if(!this.vb){var b;olympe.D.hb(a)?b=a.Da:olympe.D.$m(a)&&(b=a);b&&this.kb.set(b.V(),b)}}Tc(a,b=!0){let c;olympe.D.hb(a)?c=a.Da:olympe.D.$m(a)&&(c=a);c&&this.kb.has(c.V())&&(b&&c.mk(this),this.kb.delete(c.V()))}mk(){this.aa=null;this.destroy()}ka(){const a=this.kb;for(const b of a.keys())a.has(b)&&a.get(b).mk(this);this.kb.clear();for(const b of this.Fa.keys())this.Fa.has(b)&&
270
- this.Fa.get(b)();this.Fa.clear()}onDestroy(a,b){void 0===b&&(++this.bc,b=String(this.bc));this.ab.set(b,a);return b}Hf(a){this.ab.delete(a)}Z(a){if(void 0===b){++this.bc;var b=String(this.bc)}this.Fa.set(b,a);return b}De(a){this.Fa.delete(a)}yf(a){this.aa&&this.aa.Tc(this,!1);(this.aa=a||null)&&this.aa.Bc(this)}getParent(){return this.aa}};olympe.D.Jq=class extends olympe.D.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}Hf(){}};olympe.D.ih.ya=[olympe.D.ih];let vb=0;
271
- function wb(a,b){a.ea||(a.ea=new Map);a.ea.set(b.V(),b);switch(b.Hc()){case olympe.D.Node.C.qh:break;case olympe.D.Node.C.Bh:break;case olympe.D.Node.C.Ij:case olympe.D.Node.C.Nf:olympe.D.H.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.jh:xb(a,olympe.D.Node.C.jh);break;case olympe.D.Node.C.OBSOLETE:a.hc=!0;a.C!==olympe.D.Node.C.jh&&xb(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.Pd:olympe.D.H.warn('Adding a destroyed node as upstream => should never happen!');break;
254
+ ib(a,g);d='';e=0;b=0<=b?b:32;for(f=0;4>f;f++)for(h=a[f],g=0;4>g;g++){if(++e>b)return d;d+=c[h>>8*g+4&15];if(++e>b)return d;d+=c[h>>8*g&15]}return d}'5d41402abc4b2a76b9719d911017c592'!==jb('hello')&&(hb=(a,b)=>{const c=(a&65535)+(b&65535);return(a>>16)+(b>>16)+(c>>16)<<16|c&65535});olympe.Y.xb=jb;function kb(a){a='0'.repeat(12)+a.toString(16);return a.substring(a.length-12,a.length)}function lb(){var a=Math.random();return kb((new Date).getTime())+(a.toString(16)+'0'.repeat(8)).substr(2,8)}const mb=Math.pow(2,32)-1;olympe.Y.Nc=function(){return lb()};olympe.Y.Af=function(){return lb()};olympe.Y.GD=function(a,b=1){const c=a.substr(12,a.length-12);return kb(parseInt(a.substr(0,12),16)+b)+c};
255
+ olympe.Y.FD=function(a){return kb(parseInt(a.substr(0,12),16)+1)+(Math.random().toString(16)+'00000000').substr(2,8)};let nb=0,ob=0;olympe.Y.ww=function(){var a=(new Date).getTime();a<=nb?4294967295===ob?(ob=Math.floor(Math.random()/4*mb),nb+=1):ob=Math.floor(ob+(4294967295-ob)/2):(ob=Math.floor(Math.random()/4*mb),nb=a);a='00000000'+ob.toString(16);return kb(nb)+a.substr(a.length-8,8)};olympe.Y.VD=function(){for(let a=0;1E4>a;a++)console.log(olympe.Y.ww())};
256
+ olympe.Y.Oh=function(){let a='';for(let b=0;19>b;b++)a+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return'@'+a};olympe.Y.AD=function(a){let b='';for(let c=0;5>c;c++)b+='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'.charAt(Math.floor(62*Math.random()));return(a?a:'UI')+'-'+b};olympe.Y.wD=function(a,b){return(b?b:'UI')+'-'+a};
257
+ olympe.Y.py=function(a){var b=/^(?:(\S*)@)?([^:]+)(?::(\d{2,5}))?$/;const c=/([^&=]+)=([^&=]+)/g,d=/^true|false$/i,e=/^\d+(\.\d+)?$/;var f=a.match(/^(?:([^:/?#]+):)?(?:\/\/([^/?#]*))?\/?([^?#]*)(?:\?([^#]*))?(?:#(.*))?$/);a=f[1];const g=f[2],h=f[3],k=f[4];f=f[5];let l=null,n=null;var p=null;g&&(p=g.match(b),l=p[1],n=p[2],p=p[3]);b={};let q;for(;q=c.exec(k);){let r=q[2];void 0===r?r=!0:r.startsWith('"')&&r.endsWith('"')?r=r.substring(1,r.length-1):d.test(r)?r='true'===r.toLowerCase():e.test(r)?r=parseFloat(r):
258
+ r=decodeURIComponent(r);b[q[1]]=r}return{scheme:a||null,eD:g||null,ps:l||null,host:n||null,port:p&&parseInt(p,10)||null,path:h&&'/'!==h?h:null,query:k||null,xD:f||null,parameters:b}};olympe.Y.PD=function(a){a=a.substring(1);return''===a?new Map:new Map(a.split('&').map(b=>b.split('=').map(decodeURIComponent)))};
259
+ olympe.Y.SD=function(a){a=Array.from(a.entries()).filter(([,b])=>null!==b&&void 0!==b).map(([b,c])=>`${encodeURIComponent(b)}=${encodeURIComponent(c)}`).join('&');return 0<a.length?`#${a}`:''};olympe.Y.ED=(a,b)=>{const c=Object.keys(a).find(d=>a[d]===b);return void 0===c?null:c};olympe.Y.bn=(a,b)=>{if(b instanceof Object)for(const c of Object.keys(b)){const d=b[c];d instanceof Object&&void 0!==a[c]?olympe.Y.bn(a[c],d):a[c]=d}};
260
+ olympe.Y.Fe=(a,b,c)=>{const d=Object.create(null);b(a,e=>{olympe.Y.bn(d,e);b(`conf.d/${a}`,f=>{olympe.Y.bn(d,f);c(d)})})};olympe.Y.dD=class a{constructor(b,c){this.x=b;this.y=c}add(b){return new a(this.x+b.x,this.y+b.y)}Rm(){return Math.sqrt(this.x*this.x+this.y*this.y)}toString(){return`Vector(${this.x}, ${this.y})`}};olympe.Y.ku=class{constructor(a,b){this.start=a;this.end=b}};olympe.Y.ku.C={zA:'left',oB:'right',bz:'bottom',yC:'top'};function pb(a){return`${a.C}.${a.F}.${a.G}`}
261
+ olympe.Y.wf=class{constructor(a,b,c,d){this.C=a;this.F=b;this.G=c;this.K=d||null}static parse(a){a=/([0-9]*)\.([0-9]*)\.([0-9]*)-?([A-z\-_0-9]*)/.exec(a);if(null===a||4>a.length)return olympe.Y.wf.C;const b=Number.parseInt(a[1],10),c=Number.parseInt(a[2],10),d=Number.parseInt(a[3],10);return isNaN(b)||isNaN(c)||isNaN(d)?olympe.Y.wf.C:new olympe.Y.wf(b,c,d,a[4])}xk(a){return this.C!==a.C?this.C>a.C:this.F!==a.F?this.F>a.F:this.G>a.G}gj(a){return this.C!==a.C?this.C<a.C:this.F!==a.F?this.F<a.F:this.G<
262
+ a.G}Ga(a){return this.C===a.C&&this.F===a.F&&this.G===a.G}toString(){return`${this.C}.${this.F}.${this.G}`+(null!==this.K?`-${this.K}`:'')}};olympe.Y.wf.C=new olympe.Y.wf(Number.NaN,Number.NaN,Number.NaN);olympe.Y.R={jg:'utils.binaryConverter',Bs:'utils.base64Converter',Tf:'utils.Profiler'};olympe.W.config(a=>{Ma(a,olympe.Y.R.jg);La(a,olympe.Y.R.Bs,olympe.Y.R.jg,!0);D(a,olympe.Y.R.Tf,olympe.Y.Nu)},'Utils services');olympe.W.run([olympe.Y.R.jg,olympe.Y.R.Tf],(a,b)=>{olympe.Y.Ye=()=>a;olympe.je().isProfilerEnabled=()=>b.C;olympe.je().startProfiler=()=>b.start();olympe.je().stopProfiler=()=>b.stop();olympe.je().getProfilerEvents=()=>({events:b.G,names:Object.fromEntries(b.O.entries()),models:Object.fromEntries(b.K.entries())})});olympe.ma={};olympe.ma.Fb=class{na(){}O(){}K(){}C(){}ka(){}T(){}ua(){}aa(){}ea(){}trace(){}debug(){}log(){}info(){}warn(){}error(){}fatal(){}};olympe.ma.Fb.prototype.fatal=olympe.ma.Fb.prototype.fatal;olympe.ma.Fb.prototype.error=olympe.ma.Fb.prototype.error;olympe.ma.Fb.prototype.warn=olympe.ma.Fb.prototype.warn;olympe.ma.Fb.prototype.info=olympe.ma.Fb.prototype.info;olympe.ma.Fb.prototype.log=olympe.ma.Fb.prototype.log;olympe.ma.Fb.prototype.debug=olympe.ma.Fb.prototype.debug;olympe.ma.Fb.prototype.trace=olympe.ma.Fb.prototype.trace;
263
+ olympe.ma.Fb.C={uv:0,Nf:1,gu:2,mp:3,Jv:4,zb:5,gt:6,vi:7};olympe.ma.Fb.F={0:'TRACE',1:'DEBUG',2:'LOG',3:'INFO',4:'WARN',5:'ERROR',6:'FATAL',7:'NOTHING'};olympe.ma.Sa=class{Wc(){}};olympe.ma.pe={};function qb(a,b,c,d){a.Fa[b](`[OLYMPE.${c}]:`,d.join(' '));if(0<a.Z.size){var e=new Date;e=('00'+e.getHours()).substring(-2)+':'+('00'+e.getMinutes()).substring(-2)+':'+('00'+e.getSeconds()).substring(-2)+'.'+('00'+e.getMilliseconds()).substring(-3);for(const f of a.Z.values())f(e,c,b,...d)}}
264
+ olympe.ma.pe.Fb=class{constructor(a,b){this.name=a;this.F=b;this.G=a.toUpperCase();this.Z=new Map;this.Fa=console}na(){return this.name}O(){return this.F}K(){return this.F<=olympe.ma.Fb.C.uv}C(){return this.F<=olympe.ma.Fb.C.Nf}T(){return this.F<=olympe.ma.Fb.C.gu}ka(){return this.F<=olympe.ma.Fb.C.mp}ua(){return this.F<=olympe.ma.Fb.C.Jv}aa(){return this.F<=olympe.ma.Fb.C.zb}ea(){return this.F<=olympe.ma.Fb.C.gt}trace(...a){this.K()&&qb(this,'trace',this.G,a)}debug(...a){this.C()&&qb(this,'debug',
265
+ this.G,a)}log(...a){this.T()&&qb(this,'log',this.G,a)}info(...a){this.ka()&&qb(this,'info',this.G,a)}warn(...a){this.ua()&&qb(this,'warn',this.G,a)}error(...a){this.aa()&&qb(this,'error',this.G,a)}fatal(...a){this.ea()&&qb(this,'error',this.G,a)}};olympe.ma.pe.Fb.ya=[olympe.ma.Fb];olympe.ma.pe.Sa=class{constructor(a,b,c){this.C=a;this.F=parseInt(b,10);this.G=c;this.channels=new Map;this.H=this.Wc('logging');this.H.info('Logging initialized, global log level is '+olympe.ma.Fb.F[b])}Wc(a){var b=this.channels.get(a);if(!b){b=this.F;var c=`${olympe.ma.U.Hs}.${a}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&(b=parseInt(this.C.getParameter(c),10));let d=this.G;c=`${c}.${olympe.ma.U.ev}`;Object.prototype.hasOwnProperty.call(this.C.parameters,c.toLowerCase())&&
266
+ (d=!0===this.C.getParameter(c));b=new olympe.ma.pe.Fb(a,b,d);this.channels.set(a,b)}return b}};olympe.ma.pe.Sa.ya=[olympe.ma.Sa];olympe.ma.R={Ea:'logging.Manager'};olympe.ma.U={Vo:'logging',Wo:'logging.showLogLevel',Hs:'logging',ev:'showLogLevel'};olympe.W.config(function(a){F(a,olympe.ma.U.Vo,olympe.ma.Fb.C.mp);F(a,olympe.ma.U.Wo,!0);Ka(a,olympe.ma.R.Ea,olympe.ma.pe.Sa,olympe.W.R.kg,new olympe.W.ja(olympe.ma.U.Vo),new olympe.W.ja(olympe.ma.U.Wo))},'olympe.logging');olympe.W.run([olympe.ma.R.Ea],a=>{olympe.ma.hb=b=>a.Wc(b)},'Logging singleton getter initialization');olympe.D={};olympe.D.U={Mp:'df.nodeCreationThreshold'};const rb=[];function sb(){}function tb(){}olympe.D.J=class a{constructor(b,c,d){this.C=void 0===b?sb:b;this.F=void 0===c?rb:c;this.Z=d}static K(){var b=[];return void 0===b||0===b.length?olympe.D.J.aa:new a(tb,b)}K(){return this.C?this.C():void 0}G(){return this.F?this.F:rb}O(){return null===this.C&&null===this.F}T(){return this.C===tb}};olympe.D.J.Z=new olympe.D.J;olympe.D.J.C=new olympe.D.J(null,null);olympe.D.J.aa=new olympe.D.J(tb);olympe.D.J.G=new olympe.D.J(()=>olympe.D.ba);
267
+ olympe.D.J.F=new olympe.D.J(()=>olympe.D.Oa);olympe.D.J.O=new olympe.D.J(()=>olympe.D.fa);olympe.D.J.T=new olympe.D.J(()=>olympe.D.Ub);olympe.D.ih=class{V(){return''}ad(){return''}destroy(){}eb(){return!1}od(){return!1}run(a,...b){return a(...b)}G(a){return a}getParent(){return null}zf(){}Cc(){}Uc(){}mk(){}ka(){}onDestroy(){return''}If(){}Z(){return''}De(){}};olympe.D.ih.prototype.offDestroy=olympe.D.ih.prototype.If;olympe.D.ih.prototype.onDestroy=olympe.D.ih.prototype.onDestroy;let ub=0;olympe.W.run([new olympe.W.ja(olympe.D.U.Mp)],()=>{});
268
+ olympe.D.Zb=class{constructor(a='SimpleContext',b){++ub;this.kb=new Map;this.ab=new Map;this.Fa=new Map;this.bc=0;this.name=a;this.id=String(ub);this.K=this.vb=!1;(this.aa=void 0===b?olympe.D.$a():b)&&this.aa.Cc(this);this.debug=!1}V(){return this.id}ad(){return this.name}run(a,...b){if(!this.vb){var c=olympe.D.ks(this);a=a(...b);c&&olympe.D.ks(c);return a}}G(a){return(...b)=>this.run(a,...b)}destroy(){if(!this.vb&&!this.K){this.K=!0;this.ka();for(const a of this.ab.keys())this.ab.has(a)&&this.ab.get(a)();
269
+ this.ab.clear();this.Fa.clear();this.aa&&(this.aa.Uc(this,!1),this.aa=null);this.vb=!0;this.K=!1;this.ka()}}eb(){return this.vb}od(){return this.K}Cc(a){if(!this.vb){var b;olympe.D.ib(a)?b=a.Da:olympe.D.$m(a)&&(b=a);b&&this.kb.set(b.V(),b)}}Uc(a,b=!0){let c;olympe.D.ib(a)?c=a.Da:olympe.D.$m(a)&&(c=a);c&&this.kb.has(c.V())&&(b&&c.mk(this),this.kb.delete(c.V()))}mk(){this.aa=null;this.destroy()}ka(){const a=this.kb;for(const b of a.keys())a.has(b)&&a.get(b).mk(this);this.kb.clear();for(const b of this.Fa.keys())this.Fa.has(b)&&
270
+ this.Fa.get(b)();this.Fa.clear()}onDestroy(a,b){void 0===b&&(++this.bc,b=String(this.bc));this.ab.set(b,a);return b}If(a){this.ab.delete(a)}Z(a){if(void 0===b){++this.bc;var b=String(this.bc)}this.Fa.set(b,a);return b}De(a){this.Fa.delete(a)}zf(a){this.aa&&this.aa.Uc(this,!1);(this.aa=a||null)&&this.aa.Cc(this)}getParent(){return this.aa}};olympe.D.Kq=class extends olympe.D.Zb{constructor(){super('Root',null)}destroy(){}onDestroy(){return''}If(){}};olympe.D.ih.ya=[olympe.D.ih];let vb=0;
271
+ function wb(a,b){a.ea||(a.ea=new Map);a.ea.set(b.V(),b);switch(b.Hc()){case olympe.D.Node.C.qh:break;case olympe.D.Node.C.Ch:break;case olympe.D.Node.C.Ij:case olympe.D.Node.C.Of:olympe.D.H.warn('Not bad as such but should not happen!');break;case olympe.D.Node.C.jh:xb(a,olympe.D.Node.C.jh);break;case olympe.D.Node.C.OBSOLETE:a.hc=!0;a.C!==olympe.D.Node.C.jh&&xb(a,olympe.D.Node.C.OBSOLETE);break;case olympe.D.Node.C.Pd:olympe.D.H.warn('Adding a destroyed node as upstream => should never happen!');break;
272
272
  default:olympe.D.H.warn('Unknown state, investigate: ',b.Hc())}yb(b,a)}
273
- function zb(a){if(a.Cd){var b=[],c=[];if(a.If)if(a.If instanceof olympe.D.Node)if(Ab(a.If))b=a.If.Eb;else return;else b=a.If;else b=null;if(null!==a.ua){const e=a.$f;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Ab(h))c.push(h.Eb);else return}else c.push(a.ua[f])}if(a.Cd instanceof Function)var d=a.Cd;else b&&(b[a.Cd]||olympe.D.H.warn('looks like you forget a cast somewhere around '+a.Cd),d=b[a.Cd]);a.run(()=>{a.ka();if(void 0!==d){const e=d.apply(b,c);e&&e.qr?
274
- Bb(a,e.Da):e instanceof olympe.D.Node?Bb(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&xb(a,olympe.D.Node.C.Bh))}else Cb(a)})}}function L(a){void 0===a.Ub&&(a.Ub=a.valueType===olympe.D.Proxy?Db(void 0,a.Td):Db(a.valueType,a.Td),a.Ub.Da=a);return a.Ub}function Eb(a){void 0!==a.O&&(Fb(a.O,a),a.O=void 0)}function Gb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Bh,null!==a.T))for(const b of a.T.values())Hb(b)}function xb(a,b){b!==a.C&&(a.C=b)}
275
- function Ib(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.Ij&&a.C!==olympe.D.Node.C.qh&&a.C!==olympe.D.Node.C.jh){xb(a,olympe.D.Node.C.Ij);var b=a.T;if(b)for(const c of b.values())b.has(c.V())&&Ib(c);xb(a,olympe.D.Node.C.OBSOLETE)}}function Jb(a,b,c){if(a.C!==olympe.D.Node.C.Nf)if(b===a.O)K(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.Ij)a.hc=!0;zb(a)}}
276
- function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Eb);a.Ib||c||void 0===a.O||Eb(a);if(void 0!==b){if((a.Ib||a.C===olympe.D.Node.C.Bh||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.hb(b)&&void 0!==a.Eb){if(null===b&&null===a.Eb){Gb(a);return}if(null!==b&&null!==a.Eb&&(b.valueOf()===a.Eb.valueOf()||a.Eb.Ga&&a.Eb.Ga(b))){Gb(a);return}}if(!0===a.Ib)olympe.D.H.error("Circular dependency detected: updating a downstream node caused this node's (#"+
277
- a.V()+') value to get updated !');else{a.C===olympe.D.Node.C.Pd&&olympe.D.H.warn(`trying to set a value on a destroyed node (#${a.V()} ${a.md?', '+a.md:''})`);a.C===olympe.D.Node.C.Nf&&olympe.D.H.warn(`trying to set a value on a node being destroyed (#${a.V()} ${a.md?', '+a.md:''})`);a.Ib=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
278
- Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Oa?(c=olympe.D.Ab(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ba?(c=olympe.D.sa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.fa&&(c=olympe.D.Xb(c),d=!1)));a.Eb=c;xb(a,olympe.D.Node.C.Bh);if(b=a.T){d=0;for(const f of b.values())0<d&&Ib(f),d++;for(const f of b.values())Jb(f,a,c)}a.Ib=!1}}}
279
- function Kb(a,b){if(a.C!==olympe.D.Node.C.Nf&&a.C!==olympe.D.Node.C.Pd&&(a.C!==olympe.D.Node.C.qh||a.Cd)){var c=void 0!==a.defaultValue;a.Cd&&b!==a.O&&a.ka();if(c)K(a,a.defaultValue,!0);else if(a.Eb=void 0,xb(a,olympe.D.Node.C.qh),b=a.T)for(const d of b.values())Kb(d,a)}}function Cb(a){if(a.C!==olympe.D.Node.C.jh){xb(a,olympe.D.Node.C.jh);var b=a.T;if(b)for(const c of b.values())Cb(c);a.ka();void 0!==a.O&&Eb(a);a.Eb=a.defaultValue}}function Ab(a){return a.C===olympe.D.Node.C.Bh}
273
+ function zb(a){if(a.Cd){var b=[],c=[];if(a.Jf)if(a.Jf instanceof olympe.D.Node)if(Ab(a.Jf))b=a.Jf.Eb;else return;else b=a.Jf;else b=null;if(null!==a.ua){const e=a.$f;for(let f=0,g=a.ua.length;f<g;f++)if(null!==e&&-1<e.indexOf(f)){const h=a.ua[f];if(Ab(h))c.push(h.Eb);else return}else c.push(a.ua[f])}if(a.Cd instanceof Function)var d=a.Cd;else b&&(b[a.Cd]||olympe.D.H.warn('looks like you forget a cast somewhere around '+a.Cd),d=b[a.Cd]);a.run(()=>{a.ka();if(void 0!==d){const e=d.apply(b,c);e&&e.rr?
274
+ Bb(a,e.Da):e instanceof olympe.D.Node?Bb(a,e):(K(a,e),void 0===e&&void 0===a.valueType&&xb(a,olympe.D.Node.C.Ch))}else Cb(a)})}}function L(a){void 0===a.Vb&&(a.Vb=a.valueType===olympe.D.Proxy?Db(void 0,a.Td):Db(a.valueType,a.Td),a.Vb.Da=a);return a.Vb}function Eb(a){void 0!==a.O&&(Fb(a.O,a),a.O=void 0)}function Gb(a){if(a.C===olympe.D.Node.C.OBSOLETE&&(a.C=olympe.D.Node.C.Ch,null!==a.T))for(const b of a.T.values())Hb(b)}function xb(a,b){b!==a.C&&(a.C=b)}
275
+ function Ib(a){if(a.C!==olympe.D.Node.C.OBSOLETE&&a.C!==olympe.D.Node.C.Ij&&a.C!==olympe.D.Node.C.qh&&a.C!==olympe.D.Node.C.jh){xb(a,olympe.D.Node.C.Ij);var b=a.T;if(b)for(const c of b.values())b.has(c.V())&&Ib(c);xb(a,olympe.D.Node.C.OBSOLETE)}}function Jb(a,b,c){if(a.C!==olympe.D.Node.C.Of)if(b===a.O)K(a,c,!0);else{if(a.C===olympe.D.Node.C.OBSOLETE||a.C===olympe.D.Node.C.Ij)a.hc=!0;zb(a)}}
276
+ function K(a,b,c){b instanceof olympe.D.Node&&(olympe.D.H.warn('We are setting the value of a node as a node, that should never happen?'),b=b.Eb);a.Ib||c||void 0===a.O||Eb(a);if(void 0!==b){if((a.Ib||a.C===olympe.D.Node.C.Ch||a.C===olympe.D.Node.C.OBSOLETE)&&!olympe.D.ib(b)&&void 0!==a.Eb){if(null===b&&null===a.Eb){Gb(a);return}if(null!==b&&null!==a.Eb&&(b.valueOf()===a.Eb.valueOf()||a.Eb.Ga&&a.Eb.Ga(b))){Gb(a);return}}if(!0===a.Ib)olympe.D.H.error("Circular dependency detected: updating a downstream node caused this node's (#"+
277
+ a.V()+') value to get updated !');else{a.C===olympe.D.Node.C.Pd&&olympe.D.H.warn(`trying to set a value on a destroyed node (#${a.V()} ${a.md?', '+a.md:''})`);a.C===olympe.D.Node.C.Of&&olympe.D.H.warn(`trying to set a value on a node being destroyed (#${a.V()} ${a.md?', '+a.md:''})`);a.Ib=!0;c=b;var d=!1,e=(f,g)=>f instanceof g?!0:!1;void 0===a.valueType||null===c||e(c,a.valueType)||(e=a.valueType&&a.valueType.name?a.valueType.name:'undefined',b='object'===typeof c?b.constructor.name:typeof c,c instanceof
278
+ Object?d=!0:b.toLowerCase()!==e.toLowerCase()&&a.valueType!==Object&&(d=!0),d&&('string'===b.toLowerCase()&&a.valueType===olympe.D.Oa?(c=olympe.D.Ab(c),d=!1):'number'===b.toLowerCase()&&a.valueType===olympe.D.ba?(c=olympe.D.sa(c),d=!1):'boolean'===b.toLowerCase()&&a.valueType===olympe.D.fa&&(c=olympe.D.Xb(c),d=!1)));a.Eb=c;xb(a,olympe.D.Node.C.Ch);if(b=a.T){d=0;for(const f of b.values())0<d&&Ib(f),d++;for(const f of b.values())Jb(f,a,c)}a.Ib=!1}}}
279
+ function Kb(a,b){if(a.C!==olympe.D.Node.C.Of&&a.C!==olympe.D.Node.C.Pd&&(a.C!==olympe.D.Node.C.qh||a.Cd)){var c=void 0!==a.defaultValue;a.Cd&&b!==a.O&&a.ka();if(c)K(a,a.defaultValue,!0);else if(a.Eb=void 0,xb(a,olympe.D.Node.C.qh),b=a.T)for(const d of b.values())Kb(d,a)}}function Cb(a){if(a.C!==olympe.D.Node.C.jh){xb(a,olympe.D.Node.C.jh);var b=a.T;if(b)for(const c of b.values())Cb(c);a.ka();void 0!==a.O&&Eb(a);a.Eb=a.defaultValue}}function Ab(a){return a.C===olympe.D.Node.C.Ch}
280
280
  function Bb(a,b){b===a?olympe.D.H.error('Setting a node as provider of itself. Ignoring'):(a.O&&a.O!==b&&Eb(a),yb(b,a),Ab(b)?K(a,b.Eb,!0):void 0!==a.defaultValue?K(a,a.defaultValue,!0):Kb(a),a.O=b)}function Lb(a,b){a.Cd&&(a.Cd=void 0);a.md='Repeater';Bb(a,b)}function Hb(a){a.O?Gb(a):null!==a.ea&&0===Array.from(a.ea.values()).filter(b=>!Ab(b)).length&&(a.hc&&(a.hc=!1,zb(a)),Gb(a))}
281
281
  function yb(a,b){a.T||(a.T=new Map);a.T.set(b.V(),b);a.C===olympe.D.Node.C.Pd&&olympe.D.H.warn('adding a downstream node on a deleted one (#'+a.V()+') !')}function Fb(a,b){a.T&&(b=b.V(),a.T.has(b)&&(a.T.delete(b),Mb(a)))}function Mb(a){if(null===a.getParent()){var b=a.T;b&&0<b.size||a.destroy()}}
282
- olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,Cd:b,uy:c=!0,If:d,Wm:e,debug:f=!1,$f:g=null,md:h='Node',Oi:k}={}){++vb;super(String(vb));this.debug=!!f;this.md=h;h&&'string'===typeof h||(b?this.md=b.name?b.name:'anon()':this.md='Node');this.ua=e&&0<e.length?e:null;this.$f=g&&0<g.length?g:null;this.valueType=a;this.Eb=void 0;this.Ib=!1;this.C=olympe.D.Node.C.qh;this.hc=!1;this.T=this.ea=null;this.Cd=b;this.If=d||null;this.defaultValue=this.Ub=this.O=void 0;this.Oi=k;d&&d instanceof
282
+ olympe.D.Node=class extends olympe.D.Zb{constructor({valueType:a,Cd:b,vy:c=!0,Jf:d,Wm:e,debug:f=!1,$f:g=null,md:h='Node',Oi:k}={}){++vb;super(String(vb));this.debug=!!f;this.md=h;h&&'string'===typeof h||(b?this.md=b.name?b.name:'anon()':this.md='Node');this.ua=e&&0<e.length?e:null;this.$f=g&&0<g.length?g:null;this.valueType=a;this.Eb=void 0;this.Ib=!1;this.C=olympe.D.Node.C.qh;this.hc=!1;this.T=this.ea=null;this.Cd=b;this.Jf=d||null;this.defaultValue=this.Vb=this.O=void 0;this.Oi=k;d&&d instanceof
283
283
  olympe.D.Node&&wb(this,d);if(g)for(b=0;b<g.length;b++)a=e[g[b]],wb(this,a);c&&zb(this)}$g(a){this.defaultValue=a;this.C===olympe.D.Node.C.qh&&K(this,a,!0);return this}Pi(a){this.valueType=a}Nb(){return this.valueType||Object}asObservable(a=olympe.D.$a()){return new rxjs.Observable(b=>{const c=a.run(()=>olympe.D.createNode(this.valueType,b.next.bind(b),null,[this],[0],`Observable of ${this.md}`));c.onDestroy(()=>b.complete());return()=>c.destroy()})}Hc(){return this.C}eb(){return this.C===olympe.D.Node.C.Pd}od(){return this.C===
284
- olympe.D.Node.C.Nf}Td(...a){if(this.Oi instanceof Function)return this.Oi(...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.D.Node.C.Nf&&a!==olympe.D.Node.C.Pd||olympe.D.H.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.hb(g)&&b.push(g.Da);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Kg&&(e[g]=f.Da,b.push(g));return L(new olympe.D.Node({valueType:d.J(),
285
- Cd:c,If:this,Wm:e,debug:!1,$f:b,md:'Proxy.'+c+'()'}))}mk(a){if(null===this.getParent())olympe.D.H.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.H.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.yf(null);Mb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.Nf&&a!==olympe.D.Node.C.Pd){xb(this,olympe.D.Node.C.Nf);if(a=this.T){for(const c of a.values())if(a.has(c.V())){var b=c;b.ea&&b.ea.delete(this.V());
286
- b.O&&b.O.V()===this.V()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ea){for(const c of this.ea.values())this.ea.has(c.V())&&Fb(c,this);this.ea.clear()}this.ea=null;this.O&&(Fb(this.O,this),this.O=void 0);this.Eb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.$f&&(this.$f.length=0,this.$f=null);this.Oi=this.Cd=void 0;this.defaultValue=this.If=null;this.md=`** Destroyed ** ${this.md}`;xb(this,olympe.D.Node.C.Pd)}}ad(){return this.md}};olympe.D.Node.F='rootNode';
287
- olympe.D.Node.C={qh:0,Bh:1,jh:3,Ij:4,OBSOLETE:5,Nf:6,Pd:7};function Db(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.H.error('investigate');c=Object.create(Nb(c,a.prototype));c.Dh=a;c.rr=b;return c}function Nb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.Wl)||Object.defineProperty(b,olympe.D.Proxy.Wl,{enumerable:!1,configurable:!1,writable:!1,value:Ob(a,b)});return b[olympe.D.Proxy.Wl]}
288
- function Pb(a,b){if(a.Dh!==b){a.Dh=b;b.prototype||olympe.D.H.error('Cast not possible, provided type is not a valid type!');var c=Nb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Da&&a.Da.Pi(b)}}
289
- function Ob(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(Nb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&Ab(g)&&(g=g.Eb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.K.Z,c[d]=function(...f){f=this.rr.call(this.Da,
290
- ...f,e,d);const g=e.Z;if(g){const h=this.Da.Eb;h&&h[g]&&Pb(f,h[g])}return e.T()?this:f})}});return c}function Qb(a,b){K(a.Da,b)}function Rb(a){Kb(a.Da)}function Sb(a,b){Lb(a.Da,olympe.D.Ff(b)?b:b.Da)}function Tb(a,b){olympe.D.hb(b)||olympe.D.Ff(b)?Sb(a,b):Qb(a,b)}
291
- olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Dh=a;this.rr=b}static hb(a){return!(!a||!a.Kg)}Ga(a){return olympe.D.va([this,a],(b,c)=>b===c,Boolean)}Ad(a){return olympe.D.va([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.fa.F:olympe.D.fa.C:b.valueOf()===c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa)}asObservable(a){return this.Da.asObservable(a)}qr(){return this.Da}};olympe.D.Proxy.Wl='__opp__';olympe.D.Proxy.prototype.Kg=!0;function Ub(a,b){a.node.$g(b);return a}olympe.D.zj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.hb(a)?K(this.node,olympe.D.Ma(a)):K(this.node,a);return this}repeat(a){Lb(this.node,olympe.D.hb(a)?a.Da:a);return this}clear(){Kb(this.node);return this}tb(){return L(this.node)}getContext(){return this.node}};function Vb(a,b,c=1E3,d,e){const f=olympe.D.ic(olympe.D.ba),g=d||olympe.D.ba.Ao.Dp;let h,k,l,n;f.update(olympe.D.sa(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.D.sa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.tb()}
292
- olympe.D.ba=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Vb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.sa(b.value)}pn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Xb(!this.pn())}Oc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Ab(''):olympe.D.Ab(this.value.toString())}toString(a,b){return void 0!==
293
- 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.pn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ic(olympe.D.ba,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.sa(c))};a.forEach((f,g)=>{olympe.D.Nc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().eb()){var g=b.get(f);b.delete(f);
284
+ olympe.D.Node.C.Of}Td(...a){if(this.Oi instanceof Function)return this.Oi(...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.D.Node.C.Of&&a!==olympe.D.Node.C.Pd||olympe.D.H.warn('Calling a function on a destroyed node!!!',this);a=d.G();b=[];if(1===a.length&&-1===a[0])for(var g of e)olympe.D.ib(g)&&b.push(g.Da);else for(let h=0,k=a.length;h<k;h++)g=a[h],f=e[g],void 0!==f&&null!==f&&f.Kg&&(e[g]=f.Da,b.push(g));return L(new olympe.D.Node({valueType:d.K(),
285
+ Cd:c,Jf:this,Wm:e,debug:!1,$f:b,md:'Proxy.'+c+'()'}))}mk(a){if(null===this.getParent())olympe.D.H.warn('context is undefined, investigate');else if(this.getParent()!==a){olympe.D.H.warn('Investigate a potential issue in creator-createe link: create node mismatch',a,this.getParent());return}this.zf(null);Mb(this)}destroy(){var a=this.C;if(a!==olympe.D.Node.C.Of&&a!==olympe.D.Node.C.Pd){xb(this,olympe.D.Node.C.Of);if(a=this.T){for(const c of a.values())if(a.has(c.V())){var b=c;b.ea&&b.ea.delete(this.V());
286
+ b.O&&b.O.V()===this.V()?b.O=void 0:b.destroy()}a.clear()}this.T=null;super.destroy();if(this.ea){for(const c of this.ea.values())this.ea.has(c.V())&&Fb(c,this);this.ea.clear()}this.ea=null;this.O&&(Fb(this.O,this),this.O=void 0);this.Eb=void 0;this.ua&&(this.ua.length=0,this.ua=null);this.$f&&(this.$f.length=0,this.$f=null);this.Oi=this.Cd=void 0;this.defaultValue=this.Jf=null;this.md=`** Destroyed ** ${this.md}`;xb(this,olympe.D.Node.C.Pd)}}ad(){return this.md}};olympe.D.Node.F='rootNode';
287
+ olympe.D.Node.C={qh:0,Ch:1,jh:3,Ij:4,OBSOLETE:5,Of:6,Pd:7};function Db(a,b){if('function'!==typeof a)return new olympe.D.Proxy(a,b);var c=olympe.D.Proxy.prototype;void 0===a.prototype&&olympe.D.H.error('investigate');c=Object.create(Nb(c,a.prototype));c.Eh=a;c.sr=b;return c}function Nb(a,b){Object.prototype.hasOwnProperty.call(b,olympe.D.Proxy.Wl)||Object.defineProperty(b,olympe.D.Proxy.Wl,{enumerable:!1,configurable:!1,writable:!1,value:Ob(a,b)});return b[olympe.D.Proxy.Wl]}
288
+ function Pb(a,b){if(a.Eh!==b){a.Eh=b;b.prototype||olympe.D.H.error('Cast not possible, provided type is not a valid type!');var c=Nb(a,b.prototype);Object.setPrototypeOf?Object.setPrototypeOf(a,c):a.__proto__=c;a.Da&&a.Da.Pi(b)}}
289
+ function Ob(a,b){let c={};if(b.prototype)olympe.D.H.error('first level of prototyping, investigate');else if(b.__proto__)c=Object.create(Nb(a,b.__proto__));else return olympe.D.Proxy.prototype;Object.getOwnPropertyNames(b).forEach(d=>{if('function'===typeof b[d]&&'__getReplacementFunction'!==d){var e=b[d].L;null===e||e&&e.O()?c[d]=function(...f){var g=this.Da;if(g&&Ab(g)&&(g=g.Eb)&&g[d]&&'function'===typeof g[d])return g[d].apply(g,f)}:(e=e||b[d].__oSig__||olympe.D.J.Z,c[d]=function(...f){f=this.sr.call(this.Da,
290
+ ...f,e,d);const g=e.Z;if(g){const h=this.Da.Eb;h&&h[g]&&Pb(f,h[g])}return e.T()?this:f})}});return c}function Qb(a,b){K(a.Da,b)}function Rb(a){Kb(a.Da)}function Sb(a,b){Lb(a.Da,olympe.D.Gf(b)?b:b.Da)}function Tb(a,b){olympe.D.ib(b)||olympe.D.Gf(b)?Sb(a,b):Qb(a,b)}
291
+ olympe.D.Proxy=class{constructor(a,b){this.Da=null;this.Eh=a;this.sr=b}static ib(a){return!(!a||!a.Kg)}Ga(a){return olympe.D.va([this,a],(b,c)=>b===c,Boolean)}Ad(a){return olympe.D.va([this,a],(b,c)=>null===b||null===c?b===c?olympe.D.fa.F:olympe.D.fa.C:b.valueOf()===c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa)}asObservable(a){return this.Da.asObservable(a)}rr(){return this.Da}};olympe.D.Proxy.Wl='__opp__';olympe.D.Proxy.prototype.Kg=!0;function Ub(a,b){a.node.$g(b);return a}olympe.D.zj=class{constructor(a,b='FlowSource'){this.node=olympe.D.createNode(a,void 0,void 0,void 0,void 0,b)}update(a){olympe.D.ib(a)?K(this.node,olympe.D.Ma(a)):K(this.node,a);return this}repeat(a){Lb(this.node,olympe.D.ib(a)?a.Da:a);return this}clear(){Kb(this.node);return this}tb(){return L(this.node)}getContext(){return this.node}};function Vb(a,b,c=1E3,d,e){const f=olympe.D.ic(olympe.D.ba),g=d||olympe.D.ba.Ao.Ep;let h,k,l,n;f.update(olympe.D.sa(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.D.sa(h)),1===k&&void 0!==e&&e(h),1>k&&(n=window.requestAnimationFrame(r)))};n=window.requestAnimationFrame(r)}return f.tb()}
292
+ olympe.D.ba=class{constructor(a){this.value=void 0===a||null===a?0:a}toJSON(){return'{ "type": "number", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.sa(b.value)}pn(){return'number'===typeof this.value&&!isNaN(this.value)}isNaN(){return olympe.D.Xb(!this.pn())}Pc(){return null===this.value||void 0===this.value||void 0===this.value.toString||isNaN(this.value)?olympe.D.Ab(''):olympe.D.Ab(this.value.toString())}toString(a,b){return void 0!==
293
+ 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.pn()?this.valueOf().toFixed(a):''}static max(a){const b=new Map;let c=-Infinity;const d=olympe.D.ic(olympe.D.ba,'ONumber.max result'),e=()=>{c=-Infinity;for(const f of b.values())f>c&&(c=f);d.update(olympe.D.sa(c))};a.forEach((f,g)=>{olympe.D.Oc([f],h=>{b.set(g,h.valueOf());e()})},f=>{if(!d.getContext().eb()){var g=b.get(f);b.delete(f);
294
294
  g===c&&e()}});return d.tb()}Zd(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(b.valueOf()+c.valueOf()),olympe.D.ba,'ONumber.plus')}Yg(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(b.valueOf()-c.valueOf()),olympe.D.ba,'ONumber.minus')}round(){return olympe.D.sa(Math.round(this.valueOf()))}hj(){return olympe.D.sa(-this.valueOf())}Dk(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(b.valueOf()*c.valueOf()),olympe.D.ba,'ONumber.mul')}Ri(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(b.valueOf()/
295
- c.valueOf()),olympe.D.ba,'ONumber.div')}Ux(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(b.valueOf()%c.valueOf()),olympe.D.ba,'ONumber.div')}floor(){return olympe.D.sa(Math.floor(this.valueOf()))}ceil(){return olympe.D.sa(Math.ceil(this.valueOf()))}trunc(){return olympe.D.sa(Math.trunc(this.valueOf()))}log(){return olympe.D.sa(Math.log(this.valueOf()))}pow(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ba,'ONumber.pow')}exp(){return olympe.D.sa(Math.exp(this.valueOf()))}Ad(a){return olympe.D.va([this,
296
- a],(b,c)=>olympe.D.Xb(b.Ga(c)),olympe.D.fa,'ONumber.oEquals')}Ga(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}gx(){return this.valueOf()}Zm(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isBiggerThan')}yy(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.sa(c),olympe.D.ba,'ONumber.returnsBiggest')}gs(a){return olympe.D.va([this,
297
- a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.sa(c),olympe.D.ba,'ONumber.returnsSmallest')}Mx(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isSmallerThan')}sin(){return olympe.D.sa(Math.sin(this.valueOf()))}cos(){return olympe.D.sa(Math.cos(this.valueOf()))}atan2(a){return olympe.D.hb(a)?olympe.D.re([a],b=>olympe.D.sa(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ba):olympe.D.sa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.sa(Math.abs(this.valueOf()))}bj(a,
298
- b){return olympe.D.hb(a)||olympe.D.hb(b)?olympe.D.re([a,b],(c,d)=>olympe.D.sa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ba):olympe.D.sa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Lv(a,b,c,d){'number'===typeof a&&(a=olympe.D.Yd(a));'number'===typeof b&&(b=olympe.D.Yd(b));'number'===typeof c&&(c=olympe.D.Yd(c));let e=0;const f=olympe.D.Yd(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Zi(b.Zm(c),()=>{olympe.ma.gb('df').warn('You have a min bigger than max, cap your inputs')});
299
- const k=(l,n)=>{n=olympe.D.Yd(n);const p=olympe.D.ba.animate(n,500);Sb(f,p);Qb(n,olympe.D.sa(l));e=l};olympe.D.re([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):Sb(f,olympe.D.Yd(e))},olympe.D.ba);void 0!==b&&olympe.D.dn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.Yd(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.sa(g);K(n.Da,l);e=g;Sb(f,p)}});void 0!==c&&olympe.D.dn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.Yd(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.sa(h);K(n.Da,l);e=h;Sb(f,
300
- p)}});return f}static offset(a){let b;return olympe.D.re([a],c=>{void 0===b&&(b=c);return olympe.D.sa(c-b)},olympe.D.ba,'offset')}static Cr(a){let b,c,d;return olympe.D.va([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.sa(0);d=window.performance.now();const f=olympe.D.sa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ba,'derivative')}static Ex(a){let b=olympe.D.sa(0),c,d,e;return olympe.D.va([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.sa(0);
301
- e=window.performance.now();b=b.Zd((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ba,'integrate')}static jw(a){let b;return olympe.D.va([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.sa(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ba,'diff')}static aw(a,b,c){return olympe.D.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.D.sa(d>=e?d<=f?d:f:e)},olympe.D.ba)}static animate(a,b,c,d){let e;
302
- return e=olympe.D.va([a],f=>{const g=olympe.D.Ma(b,1E3),h=olympe.D.Ma(e);return void 0===h?olympe.D.sa(f):Vb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ba)}static Wv(a,b,c){let d,e,f,g,h,k,l=olympe.D.Yd(),n;olympe.D.Nc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);Qb(l,olympe.D.sa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Oc(a){return olympe.D.hb(a)?
303
- olympe.D.va([a],b=>olympe.D.Ab(b.valueOf().toString()),olympe.D.Oa):olympe.D.Ab(a)}static hj(a){return olympe.D.hb(a)?olympe.D.va([a],b=>olympe.D.sa(-b.valueOf()),olympe.D.ba):olympe.D.sa(-a.valueOf())}static Zd(a,b){return olympe.D.hb(a)||olympe.D.hb(b)?olympe.D.va([a,b],(c,d)=>olympe.D.sa(c.valueOf()+d.valueOf()),olympe.D.ba,'plus'):olympe.D.sa(a.valueOf()+b.valueOf())}static Yg(a,b){return olympe.D.hb(a)||olympe.D.hb(b)?olympe.D.re([a,b],(c,d)=>olympe.D.sa(c.valueOf()-d.valueOf()),olympe.D.ba,
304
- 'minus'):olympe.D.sa(a.valueOf()-b.valueOf())}static Ri(a,b){return olympe.D.hb(a)||olympe.D.hb(b)?olympe.D.re([a,b],(c,d)=>olympe.D.sa(c.valueOf()/d.valueOf()),olympe.D.ba,'div'):olympe.D.sa(a.valueOf()/b.valueOf())}static sy(a,b){if(void 0===b)return a;olympe.D.Nc([b],c=>{c=olympe.D.sa(a.Da.Eb.valueOf()+c.valueOf());K(a.Da,c)},'plusEqual');return a}};olympe.D.ba.ZERO=new olympe.D.ba(0);olympe.D.ba.ONE=new olympe.D.ba(1);olympe.D.ba.wv=new olympe.D.ba(2);olympe.D.ba.PI=new olympe.D.ba(Math.PI);
305
- olympe.D.ba.wt=new olympe.D.ba(Infinity);olympe.D.ba.qu=new olympe.D.ba(-Infinity);olympe.D.ba.Kp=new olympe.D.ba(NaN);olympe.D.ba.gB=olympe.D.ba.sy;olympe.D.ba.Sy=olympe.D.ba.Lv;olympe.D.ba.VA=olympe.D.ba.offset;olympe.D.ba.Az=olympe.D.ba.Cr;olympe.D.ba.oD=olympe.D.ba.Cr;olympe.D.ba.xA=olympe.D.ba.Ex;olympe.D.ba.Bz=olympe.D.ba.jw;olympe.D.ba.hz=olympe.D.ba.aw;olympe.D.ba.Ty=olympe.D.ba.animate;olympe.D.ba.Uy=olympe.D.ba.Wv;olympe.D.ba.AC=olympe.D.ba.Oc;olympe.D.ba.BC=olympe.D.ba.hj;
306
- olympe.D.ba.fB=olympe.D.ba.Zd;olympe.D.ba.LA=olympe.D.ba.Yg;olympe.D.ba.Cz=olympe.D.ba.Ri;
307
- olympe.D.ba.Ao={Dp:function(a,b,c,d){return c*a/d+b},Wz:function(a,b,c,d){a/=d;return c*a*a+b},fA:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Sz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},Lz:function(a,b,c,d){a/=d;return c*a*a*a+b},bA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Qz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},Xz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},gA:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
308
- Tz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},Yz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},hA:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Uz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},Zz:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},iA:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Vz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Oz:function(a,b,c,d){return c*Math.pow(2,
309
- 10*(a/d-1))+b},eA:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Rz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},Kz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},aA:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Pz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},Fz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},Gz:function(a,b,c,d){d=(a/=d)*a;return b+
310
- c*(2*d*d+2*d*a+-3*d)},Hz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Iz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},dA: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)},cA: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)},Nz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Mz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},$z:function(a,
311
- 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},Jz: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.D.ba.prototype;m.toJSON.L=olympe.D.K.C;m.pn.L=olympe.D.K.C;m.isNaN.L=olympe.D.K.O;m.Oc.L=olympe.D.K.F;
312
- m.toString.L=new olympe.D.K(()=>String,[]);m.toFixed.L=new olympe.D.K(()=>String,[]);m.Zd.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.Yg.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.round.L=olympe.D.K.G;m.hj.L=olympe.D.K.G;m.Dk.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.Ri.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.Ux.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.floor.L=olympe.D.K.G;m.ceil.L=olympe.D.K.G;m.trunc.L=olympe.D.K.G;m.log.L=olympe.D.K.G;m.pow.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.exp.L=olympe.D.K.G;
313
- m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Ga.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.gx.L=olympe.D.K.C;m.Zm.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.yy.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.gs.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.Mx.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.sin.L=olympe.D.K.G;m.cos.L=olympe.D.K.G;m.atan2.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.abs.L=olympe.D.K.G;m.bj.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);olympe.D.Oa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Vb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ab(b.value)}zr(a){return olympe.D.Oa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.va([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Ab(d)},olympe.D.Oa,'OString.concat')}Oc(){return this}My(a){return olympe.D.sa(parseInt(this.value,
314
- a))}ls(){return olympe.D.sa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ga(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Ad(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Xb(c&&b.valueOf()===c.valueOf()),olympe.D.fa,'OString.oEquals')}af(){return olympe.D.Xb(!this.value||0===this.value.length)}contains(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Xb((c instanceof olympe.D.Oa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
295
+ c.valueOf()),olympe.D.ba,'ONumber.div')}Vx(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(b.valueOf()%c.valueOf()),olympe.D.ba,'ONumber.div')}floor(){return olympe.D.sa(Math.floor(this.valueOf()))}ceil(){return olympe.D.sa(Math.ceil(this.valueOf()))}trunc(){return olympe.D.sa(Math.trunc(this.valueOf()))}log(){return olympe.D.sa(Math.log(this.valueOf()))}pow(a){return olympe.D.va([this,a],(b,c)=>olympe.D.sa(Math.pow(b.valueOf(),c.valueOf())),olympe.D.ba,'ONumber.pow')}exp(){return olympe.D.sa(Math.exp(this.valueOf()))}Ad(a){return olympe.D.va([this,
296
+ a],(b,c)=>olympe.D.Xb(b.Ga(c)),olympe.D.fa,'ONumber.oEquals')}Ga(a){return this.valueOf()===(void 0!==a&&null!==a?a.valueOf():void 0)}valueOf(){return void 0!==this.value?this.value.valueOf():void 0}hx(){return this.valueOf()}Zm(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()>c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isBiggerThan')}zy(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()>=c.valueOf()?b:olympe.D.sa(c),olympe.D.ba,'ONumber.returnsBiggest')}hs(a){return olympe.D.va([this,
297
+ a],(b,c)=>b.valueOf()<=c.valueOf()?b:olympe.D.sa(c),olympe.D.ba,'ONumber.returnsSmallest')}Nx(a){return olympe.D.va([this,a],(b,c)=>b.valueOf()<c.valueOf()?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'ONumber.isSmallerThan')}sin(){return olympe.D.sa(Math.sin(this.valueOf()))}cos(){return olympe.D.sa(Math.cos(this.valueOf()))}atan2(a){return olympe.D.ib(a)?olympe.D.qe([a],b=>olympe.D.sa(Math.atan2(this.valueOf(),b.valueOf())),olympe.D.ba):olympe.D.sa(Math.atan2(this.valueOf(),a.valueOf()))}abs(){return olympe.D.sa(Math.abs(this.valueOf()))}bj(a,
298
+ b){return olympe.D.ib(a)||olympe.D.ib(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.sa(this.valueOf()*d.valueOf()+c.valueOf()*(1-d.valueOf())),olympe.D.ba):olympe.D.sa(this.valueOf()*b.valueOf()+a.valueOf()*(1-b.valueOf()))}static Mv(a,b,c,d){'number'===typeof a&&(a=olympe.D.Yd(a));'number'===typeof b&&(b=olympe.D.Yd(b));'number'===typeof c&&(c=olympe.D.Yd(c));let e=0;const f=olympe.D.Yd(0);let g,h;void 0!==b&&void 0!==c&&olympe.D.Zi(b.Zm(c),()=>{olympe.ma.hb('df').warn('You have a min bigger than max, cap your inputs')});
299
+ const k=(l,n)=>{n=olympe.D.Yd(n);const p=olympe.D.ba.animate(n,500);Sb(f,p);Qb(n,olympe.D.sa(l));e=l};olympe.D.qe([a],l=>{e+=l.valueOf();e>h?k(h,e):e<g?k(g,e):Sb(f,olympe.D.Yd(e))},olympe.D.ba);void 0!==b&&olympe.D.dn(b.valueOf(),l=>{if(g!==l&&(g=l,g>e)){const n=olympe.D.Yd(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.sa(g);K(n.Da,l);e=g;Sb(f,p)}});void 0!==c&&olympe.D.dn(c.valueOf(),l=>{if(h!==l&&(h=l,h<e)){const n=olympe.D.Yd(e),p=olympe.D.ba.animate(n,400,d);l=olympe.D.sa(h);K(n.Da,l);e=h;Sb(f,
300
+ p)}});return f}static offset(a){let b;return olympe.D.qe([a],c=>{void 0===b&&(b=c);return olympe.D.sa(c-b)},olympe.D.ba,'offset')}static Dr(a){let b,c,d;return olympe.D.va([a],e=>{if(void 0===b)return b=e,c=window.performance.now(),olympe.D.sa(0);d=window.performance.now();const f=olympe.D.sa((e.valueOf()-b.valueOf())/(d-c));b=e;c=d;return f},olympe.D.ba,'derivative')}static Fx(a){let b=olympe.D.sa(0),c,d,e;return olympe.D.va([a],f=>{if(void 0===c)return c=f,d=window.performance.now(),olympe.D.sa(0);
301
+ e=window.performance.now();b=b.Zd((f.valueOf()+c.valueOf())/2*(e-d));c=f;d=e;return b},olympe.D.ba,'integrate')}static kw(a){let b;return olympe.D.va([a],c=>{void 0===b&&(b=c.valueOf());const d=olympe.D.sa(c.valueOf()-b.valueOf());b=c;return d},olympe.D.ba,'diff')}static bw(a,b,c){return olympe.D.qe([a,b,c],(d,e,f)=>{d='number'===typeof d?d:d.valueOf();e='number'===typeof e?e:e.valueOf();f='number'===typeof f?f:f.valueOf();return olympe.D.sa(d>=e?d<=f?d:f:e)},olympe.D.ba)}static animate(a,b,c,d){let e;
302
+ return e=olympe.D.va([a],f=>{const g=olympe.D.Ma(b,1E3),h=olympe.D.Ma(e);return void 0===h?olympe.D.sa(f):Vb(h,f,g,c,k=>{d&&d(k)})},olympe.D.ba)}static Xv(a,b,c){let d,e,f,g,h,k,l=olympe.D.Yd(),n;olympe.D.Oc([a],p=>{void 0===d?g=d=p.valueOf():d=g;f=window.performance.now();e=p.valueOf();k=e-d;0!==k&&void 0===n&&(n=setInterval(()=>{k=e-d;h=(window.performance.now()-f)/b;1<=h&&(h=1);g=d+k*c(h,0,1,1);Qb(l,olympe.D.sa(g));1===h&&(clearTimeout(n),n=void 0)},0))});return l}static Pc(a){return olympe.D.ib(a)?
303
+ olympe.D.va([a],b=>olympe.D.Ab(b.valueOf().toString()),olympe.D.Oa):olympe.D.Ab(a)}static hj(a){return olympe.D.ib(a)?olympe.D.va([a],b=>olympe.D.sa(-b.valueOf()),olympe.D.ba):olympe.D.sa(-a.valueOf())}static Zd(a,b){return olympe.D.ib(a)||olympe.D.ib(b)?olympe.D.va([a,b],(c,d)=>olympe.D.sa(c.valueOf()+d.valueOf()),olympe.D.ba,'plus'):olympe.D.sa(a.valueOf()+b.valueOf())}static Yg(a,b){return olympe.D.ib(a)||olympe.D.ib(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.sa(c.valueOf()-d.valueOf()),olympe.D.ba,
304
+ 'minus'):olympe.D.sa(a.valueOf()-b.valueOf())}static Ri(a,b){return olympe.D.ib(a)||olympe.D.ib(b)?olympe.D.qe([a,b],(c,d)=>olympe.D.sa(c.valueOf()/d.valueOf()),olympe.D.ba,'div'):olympe.D.sa(a.valueOf()/b.valueOf())}static ty(a,b){if(void 0===b)return a;olympe.D.Oc([b],c=>{c=olympe.D.sa(a.Da.Eb.valueOf()+c.valueOf());K(a.Da,c)},'plusEqual');return a}};olympe.D.ba.ZERO=new olympe.D.ba(0);olympe.D.ba.ONE=new olympe.D.ba(1);olympe.D.ba.xv=new olympe.D.ba(2);olympe.D.ba.PI=new olympe.D.ba(Math.PI);
305
+ olympe.D.ba.xt=new olympe.D.ba(Infinity);olympe.D.ba.ru=new olympe.D.ba(-Infinity);olympe.D.ba.Lp=new olympe.D.ba(NaN);olympe.D.ba.hB=olympe.D.ba.ty;olympe.D.ba.Ty=olympe.D.ba.Mv;olympe.D.ba.WA=olympe.D.ba.offset;olympe.D.ba.Bz=olympe.D.ba.Dr;olympe.D.ba.pD=olympe.D.ba.Dr;olympe.D.ba.yA=olympe.D.ba.Fx;olympe.D.ba.Cz=olympe.D.ba.kw;olympe.D.ba.iz=olympe.D.ba.bw;olympe.D.ba.Uy=olympe.D.ba.animate;olympe.D.ba.Vy=olympe.D.ba.Xv;olympe.D.ba.BC=olympe.D.ba.Pc;olympe.D.ba.CC=olympe.D.ba.hj;
306
+ olympe.D.ba.gB=olympe.D.ba.Zd;olympe.D.ba.MA=olympe.D.ba.Yg;olympe.D.ba.Dz=olympe.D.ba.Ri;
307
+ olympe.D.ba.Ao={Ep:function(a,b,c,d){return c*a/d+b},Xz:function(a,b,c,d){a/=d;return c*a*a+b},gA:function(a,b,c,d){a/=d;return-c*a*(a-2)+b},Tz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a+b;a--;return-c/2*(a*(a-2)-1)+b},Mz:function(a,b,c,d){a/=d;return c*a*a*a+b},cA:function(a,b,c,d){a/=d;a--;return c*(a*a*a+1)+b},Rz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a+b;a-=2;return c/2*(a*a*a+2)+b},Yz:function(a,b,c,d){a/=d;return c*a*a*a*a+b},hA:function(a,b,c,d){a/=d;a--;return-c*(a*a*a*a-1)+b},
308
+ Uz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a+b;a-=2;return-c/2*(a*a*a*a-2)+b},Zz:function(a,b,c,d){a/=d;return c*a*a*a*a*a+b},iA:function(a,b,c,d){a/=d;a--;return c*(a*a*a*a*a+1)+b},Vz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*a*a*a*a*a+b;a-=2;return c/2*(a*a*a*a*a+2)+b},$z:function(a,b,c,d){return-c*Math.cos(a/d*(Math.PI/2))+c+b},jA:function(a,b,c,d){return c*Math.sin(a/d*(Math.PI/2))+b},Wz:function(a,b,c,d){return-c/2*(Math.cos(Math.PI*a/d)-1)+b},Pz:function(a,b,c,d){return c*Math.pow(2,
309
+ 10*(a/d-1))+b},fA:function(a,b,c,d){return c*(-Math.pow(2,-10*a/d)+1)+b},Sz:function(a,b,c,d){a/=d/2;if(1>a)return c/2*Math.pow(2,10*(a-1))+b;a--;return c/2*(-Math.pow(2,-10*a)+2)+b},Lz:function(a,b,c,d){a/=d;return-c*(Math.sqrt(1-a*a)-1)+b},bA:function(a,b,c,d){a/=d;a--;return c*Math.sqrt(1-a*a)+b},Qz:function(a,b,c,d){a/=d/2;if(1>a)return-c/2*(Math.sqrt(1-a*a)-1)+b;a-=2;return c/2*(Math.sqrt(1-a*a)+1)+b},Gz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-3*d)},Hz:function(a,b,c,d){d=(a/=d)*a;return b+
310
+ c*(2*d*d+2*d*a+-3*d)},Iz:function(a,b,c,d){d=(a/=d)*a;return b+c*(4*d*a+-9*d+6*a)},Jz:function(a,b,c,d){d=(a/=d)*a;return b+c*(-2*d*d+10*d*a+-15*d+8*a)},eA: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)},dA: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)},Oz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(33*a*d+-59*d*d+32*a+-5*d)},Nz:function(a,b,c,d){d=(a/=d)*a;a*=d;return b+c*(56*a*d+-105*d*d+60*a+-10*d)},aA:function(a,
311
+ 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},Kz: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.D.ba.prototype;m.toJSON.L=olympe.D.J.C;m.pn.L=olympe.D.J.C;m.isNaN.L=olympe.D.J.O;m.Pc.L=olympe.D.J.F;
312
+ m.toString.L=new olympe.D.J(()=>String,[]);m.toFixed.L=new olympe.D.J(()=>String,[]);m.Zd.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.Yg.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.round.L=olympe.D.J.G;m.hj.L=olympe.D.J.G;m.Dk.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.Ri.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.Vx.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.floor.L=olympe.D.J.G;m.ceil.L=olympe.D.J.G;m.trunc.L=olympe.D.J.G;m.log.L=olympe.D.J.G;m.pow.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.exp.L=olympe.D.J.G;
313
+ m.Ad.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.Ga.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;m.hx.L=olympe.D.J.C;m.Zm.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.zy.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.hs.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.Nx.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.sin.L=olympe.D.J.G;m.cos.L=olympe.D.J.G;m.atan2.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.abs.L=olympe.D.J.G;m.bj.L=new olympe.D.J(()=>olympe.D.ba,[0,1]);olympe.D.Oa=class{constructor(a){this.value=a}toJSON(){return'{ "type": "string", "value": '+JSON.stringify(this.value)+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Ab(b.value)}Ar(a){return olympe.D.Oa.concat(this,'.',a)}concat(...a){let b;Array.isArray(a[0])?b=a[0]:b=a;return olympe.D.va([this,...b],(...c)=>{let d='';for(let e=0,f=c.length;e<f;e++)d=c[e]?d+c[e].valueOf():d+c[e];return olympe.D.Ab(d)},olympe.D.Oa,'OString.concat')}Pc(){return this}Ny(a){return olympe.D.sa(parseInt(this.value,
314
+ a))}ms(){return olympe.D.sa(parseFloat(this.value))}toString(){return this.value}valueOf(){return this.value.valueOf()}Ga(a){return this.value===(void 0===a||null===a?void 0:a.valueOf())}Ad(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Xb(c&&b.valueOf()===c.valueOf()),olympe.D.fa,'OString.oEquals')}af(){return olympe.D.Xb(!this.value||0===this.value.length)}contains(a){return olympe.D.va([this,a],(b,c)=>olympe.D.Xb((c instanceof olympe.D.Oa||'string'===typeof c)&&b.valueOf().includes(c.valueOf())),
315
315
  olympe.D.fa,'OString.contains')}startsWith(a,b){return olympe.D.va([this,a,b||0],(c,d,e)=>olympe.D.Xb(c.valueOf().startsWith(d.valueOf(),e.valueOf())),olympe.D.fa,'OString.startsWith')}endsWith(a,b){return olympe.D.va([this,a,b||-1],(c,d,e)=>{e=0<=e.valueOf()?e.valueOf():this.Rm().valueOf()+e.valueOf()+1;return olympe.D.Xb(c.valueOf().endsWith(d.valueOf(),e))},olympe.D.fa,'OString.endsWith')}indexOf(a,b){return olympe.D.va([this,a,b||0],(c,d,e)=>olympe.D.sa(c.valueOf().indexOf(d.valueOf(),e.valueOf())),
316
316
  olympe.D.ba,'OString.indexOf')}lastIndexOf(a,b){return olympe.D.va([this,a,b||Infinity],(c,d,e)=>olympe.D.sa(c.valueOf().lastIndexOf(d.valueOf(),e.valueOf())),olympe.D.ba,'OString.lastIndexOf')}slice(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().slice(d.valueOf(),e?e.valueOf():void 0)),olympe.D.Oa,'OString.slice')}Rm(){return olympe.D.sa(this.value.length)}threshold(a){return olympe.D.va([this,a],(b,c)=>b.valueOf().length>=c.valueOf()?b:olympe.D.Oa.EMPTY,olympe.D.Oa,'OString.threshold')}toLowerCase(){return olympe.D.Ab(this.value.toLowerCase())}toUpperCase(){return olympe.D.Ab(this.value.toUpperCase())}trim(){return olympe.D.Ab(this.value.trim())}padStart(a,
317
- b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Oa,'OString.padStart')}padEnd(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Oa,'OString.padEnd')}replace(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Oa,'OString.replace')}Iy(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().substr(d.valueOf(),
318
- e.valueOf())),olympe.D.Oa,'OString.subOStr')}static concat(...a){return olympe.D.Ab('').concat(...a)}};olympe.D.Oa.EMPTY=new olympe.D.Oa('');olympe.D.Oa.gv=new olympe.D.Oa(' ');m=olympe.D.Oa.prototype;m.toJSON.L=olympe.D.K.C;m.zr.L=new olympe.D.K(()=>olympe.D.Oa,[0,1]);m.concat.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.My.L=olympe.D.K.G;m.ls.L=olympe.D.K.G;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;m.Ga.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.af.L=olympe.D.K.O;
319
- m.contains.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.startsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.endsWith.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.indexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.lastIndexOf.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.slice.L=new olympe.D.K(()=>olympe.D.Oa,[0,1]);m.Rm.L=olympe.D.K.G;m.threshold.L=new olympe.D.K(()=>olympe.D.Oa,[0]);m.toLowerCase.L=olympe.D.K.F;m.toUpperCase.L=olympe.D.K.F;m.trim.L=olympe.D.K.F;m.padStart.L=olympe.D.K.F;m.padEnd.L=olympe.D.K.F;
320
- m.replace.L=olympe.D.K.F;m.Iy.L=olympe.D.K.F;olympe.D.fa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Vb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.fa.F:olympe.D.fa.C}and(a){if(void 0!==a)return olympe.D.hb(a)?olympe.D.re([a],b=>new olympe.D.fa(this.valueOf()&&b.valueOf()),olympe.D.fa,'and'):this.value&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}Ga(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Ad(a){if(void 0!==a)return olympe.D.hb(a)?
321
- olympe.D.re([a],b=>new olympe.D.fa(this.valueOf()===b.valueOf()),olympe.D.fa,'oEquals'):this.Ga(a)?olympe.D.fa.F:olympe.D.fa.C}pd(){return this.value?olympe.D.fa.C:olympe.D.fa.F}Vv(a){if(void 0!==a)return olympe.D.hb(a)?olympe.D.re([a],b=>new olympe.D.fa(!(this.valueOf()&&b.valueOf())),olympe.D.fa,'andNot'):this.value&&!a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}or(a){if(void 0!==a)return olympe.D.hb(a)?olympe.D.re([a],b=>new olympe.D.fa(this.valueOf()||b.valueOf()),olympe.D.fa,'or'):this.value||a.valueOf()?
322
- olympe.D.fa.F:olympe.D.fa.C}xor(a){return olympe.D.va([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Xb(b&&!c||!b&&c)},olympe.D.fa,'OBoolean.xor')}xw(){return this.value}Rr(){return!0===this.value?olympe.D.ba.ONE:olympe.D.ba.ZERO}Oc(){return olympe.D.Ab(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.fa.F=new olympe.D.fa(!0);olympe.D.fa.C=new olympe.D.fa(!1);m=olympe.D.fa.prototype;m.toJSON.L=olympe.D.K.C;
323
- m.and.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Ga.L=olympe.D.K.C;m.Ad.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.pd.L=olympe.D.K.O;m.Vv.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.or.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.xor.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.xw.L=new olympe.D.K(()=>Boolean,[]);m.Rr.L=olympe.D.K.G;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.valueOf.L=olympe.D.K.C;function Wb(a){return new olympe.D.ib(new Date(a))}
324
- olympe.D.ib=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Vb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.ib(new Date(b.value.valueOf()))}static now(){return new olympe.D.ib(new Date)}$i(){return this.rb&&!isNaN(this.rb.getTime())?olympe.D.fa.F:olympe.D.fa.C}Et(){return olympe.D.sa(this.rb.getMilliseconds())}Gt(){return olympe.D.sa(this.rb.getSeconds())}Ft(){return olympe.D.sa(this.rb.getMinutes())}Dt(){return olympe.D.sa(this.rb.getHours())}Kw(){return olympe.D.sa(this.rb.getDate())}getMonth(){return olympe.D.sa(this.rb.getMonth()+1)}Ht(){return olympe.D.sa(this.rb.getFullYear())}getTime(){return this.rb.getTime()}Fy(){var a=
317
+ b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padStart(d.valueOf(),e.valueOf())),olympe.D.Oa,'OString.padStart')}padEnd(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().padEnd(d.valueOf(),e.valueOf())),olympe.D.Oa,'OString.padEnd')}replace(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().replace(d.valueOf(),e.valueOf())),olympe.D.Oa,'OString.replace')}Jy(a,b){return olympe.D.va([this,a,b],(c,d,e)=>olympe.D.Ab(c.valueOf().substr(d.valueOf(),
318
+ e.valueOf())),olympe.D.Oa,'OString.subOStr')}static concat(...a){return olympe.D.Ab('').concat(...a)}};olympe.D.Oa.EMPTY=new olympe.D.Oa('');olympe.D.Oa.hv=new olympe.D.Oa(' ');m=olympe.D.Oa.prototype;m.toJSON.L=olympe.D.J.C;m.Ar.L=new olympe.D.J(()=>olympe.D.Oa,[0,1]);m.concat.L=olympe.D.J.F;m.Pc.L=olympe.D.J.F;m.Ny.L=olympe.D.J.G;m.ms.L=olympe.D.J.G;m.toString.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;m.Ga.L=olympe.D.J.C;m.Ad.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.af.L=olympe.D.J.O;
319
+ m.contains.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.startsWith.L=new olympe.D.J(()=>olympe.D.fa,[0,1]);m.endsWith.L=new olympe.D.J(()=>olympe.D.fa,[0,1]);m.indexOf.L=new olympe.D.J(()=>olympe.D.ba,[0,1]);m.lastIndexOf.L=new olympe.D.J(()=>olympe.D.ba,[0,1]);m.slice.L=new olympe.D.J(()=>olympe.D.Oa,[0,1]);m.Rm.L=olympe.D.J.G;m.threshold.L=new olympe.D.J(()=>olympe.D.Oa,[0]);m.toLowerCase.L=olympe.D.J.F;m.toUpperCase.L=olympe.D.J.F;m.trim.L=olympe.D.J.F;m.padStart.L=olympe.D.J.F;m.padEnd.L=olympe.D.J.F;
320
+ m.replace.L=olympe.D.J.F;m.Jy.L=olympe.D.J.F;olympe.D.fa=class{constructor(a){this.value=a}toJSON(){return`{ "type": "boolean", "value": ${this.value.valueOf()}}`}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return b.value?olympe.D.fa.F:olympe.D.fa.C}and(a){if(void 0!==a)return olympe.D.ib(a)?olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()&&b.valueOf()),olympe.D.fa,'and'):this.value&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}Ga(a){return this.valueOf()===(void 0!==a?a.valueOf():void 0)}Ad(a){if(void 0!==a)return olympe.D.ib(a)?
321
+ olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()===b.valueOf()),olympe.D.fa,'oEquals'):this.Ga(a)?olympe.D.fa.F:olympe.D.fa.C}pd(){return this.value?olympe.D.fa.C:olympe.D.fa.F}Wv(a){if(void 0!==a)return olympe.D.ib(a)?olympe.D.qe([a],b=>new olympe.D.fa(!(this.valueOf()&&b.valueOf())),olympe.D.fa,'andNot'):this.value&&!a.valueOf()?olympe.D.fa.F:olympe.D.fa.C}or(a){if(void 0!==a)return olympe.D.ib(a)?olympe.D.qe([a],b=>new olympe.D.fa(this.valueOf()||b.valueOf()),olympe.D.fa,'or'):this.value||a.valueOf()?
322
+ olympe.D.fa.F:olympe.D.fa.C}xor(a){return olympe.D.va([this,a],(b,c)=>{b=b.valueOf();c=c.valueOf();return olympe.D.Xb(b&&!c||!b&&c)},olympe.D.fa,'OBoolean.xor')}yw(){return this.value}Sr(){return!0===this.value?olympe.D.ba.ONE:olympe.D.ba.ZERO}Pc(){return olympe.D.Ab(this.toString())}toString(){return this.value?'true':'false'}valueOf(){return this.value}};olympe.D.fa.F=new olympe.D.fa(!0);olympe.D.fa.C=new olympe.D.fa(!1);m=olympe.D.fa.prototype;m.toJSON.L=olympe.D.J.C;
323
+ m.and.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.Ga.L=olympe.D.J.C;m.Ad.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.pd.L=olympe.D.J.O;m.Wv.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.or.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.xor.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.yw.L=new olympe.D.J(()=>Boolean,[]);m.Sr.L=olympe.D.J.G;m.Pc.L=olympe.D.J.F;m.toString.L=olympe.D.J.C;m.valueOf.L=olympe.D.J.C;function Wb(a){return new olympe.D.fb(new Date(a))}
324
+ olympe.D.fb=class{constructor(a){this.rb=a}toJSON(){return'{ "type": "dateTime", "value": "'+this.rb.toJSON()+'" }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.fb(new Date(b.value.valueOf()))}static now(){return new olympe.D.fb(new Date)}$i(){return this.rb&&!isNaN(this.rb.getTime())?olympe.D.fa.F:olympe.D.fa.C}Ft(){return olympe.D.sa(this.rb.getMilliseconds())}Ht(){return olympe.D.sa(this.rb.getSeconds())}Gt(){return olympe.D.sa(this.rb.getMinutes())}Et(){return olympe.D.sa(this.rb.getHours())}Lw(){return olympe.D.sa(this.rb.getDate())}getMonth(){return olympe.D.sa(this.rb.getMonth()+1)}It(){return olympe.D.sa(this.rb.getFullYear())}getTime(){return this.rb.getTime()}Gy(){var a=
325
325
  olympe.D,b=a.Ab;var c=this.rb.getDate();c=10>c?'0'+c:c;var d=this.rb.getMonth()+1;return b.call(a,`${c}.${10>d?'0'+d:d}.${this.rb.getFullYear()}`)}toLocaleString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleString(c.valueOf())),olympe.D.Oa)}toLocaleDateString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleDateString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleDateString(c.valueOf())),
326
- olympe.D.Oa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleTimeString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleTimeString(c.valueOf())),olympe.D.Oa)}Oc(){return olympe.D.Ab(this.rb.toISOString())}Jy(){return new Date(this.getTime())}Ly(){return this}Ny(){return this}Zf(a,b){return olympe.D.va([b],c=>{const d=new olympe.D.ib(new Date(this.rb.getTime()));d.rb['set'+a](this.rb['get'+a]()+c.valueOf());return d},olympe.D.ib)}Nv(a){return this.Zf('Milliseconds',
327
- a)}Sv(a){return this.Zf('Seconds',a)}Ov(a){return this.Zf('Minutes',a)}Mv(a){return this.Zf('Hours',a)}Am(a){return this.Zf('Date',a)}Tv(a){return'number'===typeof a?this.Am(7*a):this.Am(a.Dk(7))}Pv(a){return this.Zf('Month',a)}Uv(a){return this.Zf('FullYear',a)}Gy(){let a=this.rb.getDay();a=0===a?6:a-1;return new olympe.D.ib(new Date(this.rb.getFullYear(),this.rb.getMonth(),this.rb.getDate()-a))}Hy(){return new olympe.D.ib(new Date(this.rb.getFullYear(),this.rb.getMonth()))}Ad(a){return olympe.D.va([a],
328
- b=>olympe.D.Xb(this.Ga(b)),olympe.D.fa)}Ga(a){return a instanceof olympe.D.ib?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Ww(){let a=this.rb.getDay();0===a&&(a=7);return olympe.D.sa(a)}Ow(a,b){return olympe.D.va([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.rb.getFullYear()-c.rb.getFullYear():'months'===d?c=12*(this.rb.getFullYear()-c.rb.getFullYear())+(this.rb.getMonth()-c.rb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
329
- void 0===d&&(olympe.ma.gb('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.D.sa(c)},olympe.D.ba)}Hx(a){return olympe.D.va([a],b=>olympe.D.Xb(this.getTime()<b.getTime()),olympe.D.fa)}Fx(a){return olympe.D.va([a],b=>olympe.D.Xb(this.getTime()>b.getTime()),olympe.D.fa)}Ix(a,b){return olympe.D.va([a,b],(c,d)=>olympe.D.Xb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.fa)}valueOf(){return this.$i().valueOf()?
330
- new Date(this.getTime()):new Date(0)}};olympe.D.ib.C=Wb(0);olympe.D.ib.F=Wb(Number.NaN);m=olympe.D.ib.prototype;m.$i.L=olympe.D.K.O;m.Et.L=olympe.D.K.G;m.Gt.L=olympe.D.K.G;m.Ft.L=olympe.D.K.G;m.Dt.L=olympe.D.K.G;m.Kw.L=olympe.D.K.G;m.getMonth.L=olympe.D.K.G;m.Ht.L=olympe.D.K.G;m.getTime.L=olympe.D.K.C;m.Fy.L=new olympe.D.K(()=>olympe.D.Oa,[0]);m.toLocaleString.L=olympe.D.K.F;m.toLocaleDateString.L=olympe.D.K.F;m.toLocaleTimeString.L=olympe.D.K.F;m.Oc.L=olympe.D.K.F;m.Jy.L=olympe.D.K.C;
331
- m.Ly.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Ny.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Zf.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Nv.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Sv.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Ov.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Mv.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Am.L=new olympe.D.K(()=>olympe.D.ib,[0]);m.Tv.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Pv.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Uv.L=new olympe.D.K(()=>olympe.D.ib,[0]);
332
- m.Gy.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Hy.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Ad.L=olympe.D.K.O;m.Ga.L=olympe.D.K.C;m.Ww.L=olympe.D.K.G;m.Ow.L=new olympe.D.K(()=>olympe.D.ba,[0,1]);m.Hx.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Fx.L=new olympe.D.K(()=>olympe.D.fa,[0]);m.Ix.L=new olympe.D.K(()=>olympe.D.fa,[0,1]);m.valueOf.L=olympe.D.K.C;const Xb=new Map,Yb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,Zb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function $b(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=Zb.exec(c)):(d=1,c=Yb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.bf(a)?olympe.D.re([a],b,olympe.D.Color):b(a)}
333
- olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.sa(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.sa(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.sa(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.sa(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.C.valueOf(),g:this.F.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Vb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Color.create(b.r,
334
- b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.va([a,b,c,d],(e,f,g,h)=>{e=olympe.D.sa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.sa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.sa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.sa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of Xb.values())if(k&&k.C.Ga(e)&&k.F.Ga(f)&&k.b.Ga(g)&&k.a.Ga(h))return k;return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Sg(){return this.C}Mg(){return this.b}Pg(){return this.F}Lg(){return this.a}Zv(a,
335
- b){return olympe.D.Color.create(this.C.bj(a.Sg(),b),this.F.bj(a.Pg(),b),this.b.bj(a.Mg(),b),this.a.bj(a.Lg(),b))}qw(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ms(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}mn(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.mn()}Ga(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&
336
- this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.Sg().valueOf()<<16|this.Pg().valueOf()<<8|this.Mg().valueOf())-(a.Sg().valueOf()<<16|a.Pg().valueOf()<<8|a.Mg().valueOf());return 0===b?this.Lg().valueOf()-a.Lg().valueOf():b}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Ga;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.mn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ms;
337
- olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Lg;olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Pg;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Mg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Sg;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.L=olympe.D.K.C;m.Sg.L=olympe.D.K.G;m.Mg.L=olympe.D.K.G;m.Pg.L=olympe.D.K.G;m.Lg.L=olympe.D.K.G;m.Zv.L=new olympe.D.K(()=>olympe.D.Color,[]);
338
- m.qw.L=new olympe.D.K(()=>olympe.D.Color,[]);m.ms.L=new olympe.D.K(()=>String,[]);m.mn.L=new olympe.D.K(()=>String,[]);m.Ga.L=olympe.D.K.C;m.compare.L=olympe.D.K.C;olympe.D.File=class{na(){}tp(){}up(){}Qr(){}rk(){}Om(){}sk(){}rename(){}};olympe.D.Tb=class{constructor(a,b){this.x=olympe.D.Yd(a);this.y=olympe.D.Yd(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ma(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ma(this.y).valueOf())+' }'}static Vb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Tb(b.x,b.y)}vp(){return this.x}Dy(a){Tb(this.x,a)}wp(){return this.y}Ey(a){Tb(this.y,a)}sx(){return this.x.gs(this.y)}Zd(a){return olympe.D.va([this,a],(b,c)=>new olympe.D.Tb(b.x.Zd(c.x),b.y.Zd(c.y)),
339
- olympe.D.Tb,'Vector2.plus')}Yg(a){return olympe.D.va([this,a],(b,c)=>new olympe.D.Tb(b.x.Yg(c.x),b.y.Yg(c.y)),olympe.D.Tb,'Vector2.minus')}Wx(a){return new olympe.D.Tb(this.x.Dk(a),this.y.Dk(a))}lw(a){return new olympe.D.Tb(this.x.Ri(a),this.y.Ri(a))}Yx(){return new olympe.D.Tb(this.x.hj(),this.y.hj())}mw(a){return olympe.D.va([this,a],(b,c)=>olympe.D.va([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.sa(d*f+e*g),olympe.D.ba),olympe.D.ba)}length(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.sa(Math.sqrt(a*
340
- a+b*b)),olympe.D.ba)}normalize(){return olympe.D.va([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Tb(a/c,b/c)},olympe.D.Tb)}floor(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.Tb(Math.floor(a),Math.floor(b)),olympe.D.Tb)}ceil(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.Tb(Math.ceil(a),Math.ceil(b)),olympe.D.Tb)}round(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.Tb(Math.round(a),Math.round(b)),olympe.D.Tb)}Qv(a){return new olympe.D.Tb(this.x.Zd(a),
341
- this.y.Zd(a))}Rv(a,b){return new olympe.D.Tb(this.x.Zd(a),this.y.Zd(b))}Oc(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.Ab(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Oa)}toString(){return`Vector2[${this.x.Da.Eb}, ${this.y.Da.Eb}]`}Ga(a){return this===a?!0:!1}};m=olympe.D.Tb.prototype;m.toJSON.L=olympe.D.K.C;m.vp.L=olympe.D.K.G;m.Dy.L=olympe.D.K.C;m.wp.L=olympe.D.K.G;m.Ey.L=olympe.D.K.C;m.sx.L=olympe.D.K.G;m.Zd.L=new olympe.D.K(()=>olympe.D.Tb,[0]);
342
- m.Yg.L=new olympe.D.K(()=>olympe.D.Tb,[0]);m.Wx.L=olympe.D.K.T;m.lw.L=olympe.D.K.T;m.Yx.L=olympe.D.K.T;m.mw.L=new olympe.D.K(()=>olympe.D.ba,[0]);m.length.L=olympe.D.K.G;m.normalize.L=olympe.D.K.T;m.floor.L=olympe.D.K.T;m.ceil.L=olympe.D.K.T;m.round.L=olympe.D.K.T;m.Qv.L=olympe.D.K.T;m.Rv.L=olympe.D.K.T;m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Ga.L=olympe.D.K.C;olympe.D.pg=class{constructor(){}Nb(){}Hd(){}get(){}Ph(){}has(){}Vg(){}Gc(){}Cf(){}lf(){}bg(){}forEach(){}he(){}};olympe.D.pg.prototype.forEachCurrentValue=olympe.D.pg.prototype.he;olympe.D.pg.prototype.forEach=olympe.D.pg.prototype.forEach;m=olympe.D.pg.prototype;m.has.L=olympe.D.K.O;m.Vg.L=olympe.D.K.C;m.Gc.L=new olympe.D.K(()=>Object,[]);m.Cf.L=new olympe.D.K(()=>String,[]);m.lf.L=olympe.D.K.G;m.bg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;olympe.D.ld=class extends olympe.D.pg{Wd(){}Bf(){}$e(){}Af(){}ie(){}Ze(){}Si(){}Rh(){}};olympe.D.ld.prototype.getCurrentAt=olympe.D.ld.prototype.Ze;olympe.D.ld.prototype.getAt=olympe.D.ld.prototype.ie;olympe.D.ld.prototype.getCurrentKeyAt=olympe.D.ld.prototype.Af;olympe.D.ld.prototype.getKeyAt=olympe.D.ld.prototype.$e;olympe.D.ld.prototype.getCurrentRank=olympe.D.ld.prototype.Bf;olympe.D.ld.prototype.getRank=olympe.D.ld.prototype.Wd;m=olympe.D.ld.prototype;m.Wd.L=olympe.D.K.G;m.Bf.L=olympe.D.K.C;
343
- m.$e.L=new olympe.D.K(()=>String,[]);m.Af.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.Si.L=olympe.D.K.C;m.Rh.L=new olympe.D.K(()=>Array,[]);olympe.D.Xh=class{constructor(a,b){this.O=b||olympe.D.$a();this.valueType=a||Object;this.values={};this.kb=this.ua=null;this.De=0;this.Z=Object.create(null);this.vb=Object.create(null);this.size=0;this.J=null;this.O.onDestroy(()=>{const c=this.Z;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.O}Nb(){return this.valueType}Hd(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
344
- c)&&Pb(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.Vi(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.va([a],c=>b(c),this.valueType)}Ph(a){a=this.values[a];return olympe.D.hb(a)?Ab(a.Da)?a.Da.Eb:void 0:a}has(a){const b=c=>{null===this.kb&&(this.kb={});return this.Vi(this.kb,c,c in this.values?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'Map.has('+c+')')};return olympe.D.va([a],c=>b(c),olympe.D.fa)}Vg(a){return a in this.values}Vi(a,b,c,d,e){let f=a[b];
345
- f||this.O.run(()=>{f=olympe.D.Md(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.hb(c)?Sb(f,c):Qb(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Cf(){throw Error('Abstract method getFirstKey needs to be overridden');}lf(){null===this.J&&this.O.run(()=>{this.J=olympe.D.Md(olympe.D.ba,olympe.D.sa(this.size));this.J.Da.onDestroy(()=>{this.J=null})});return this.J}bg(){return this.size}forEach(a,b){const c=this.wm();a=this.sr(c,a,b);this.vm(c,a)}wm(){return String(++this.De)}vm(a,
346
- b){this.vb[a]=b;olympe.D.$a().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.vb[a]});this.he(b)}sr(a,b,c){const d=olympe.D.$a();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.zm(a,f,g)})}}zm(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}he(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
326
+ olympe.D.Oa)}toLocaleTimeString(a){return void 0===a||'string'===typeof a?olympe.D.Ab(this.rb.toLocaleTimeString(a)):olympe.D.va([this,a],(b,c)=>olympe.D.Ab(b.rb.toLocaleTimeString(c.valueOf())),olympe.D.Oa)}Pc(){return olympe.D.Ab(this.rb.toISOString())}Ky(){return new Date(this.getTime())}My(){return this}Oy(){return this}Zf(a,b){return olympe.D.va([b],c=>{const d=new olympe.D.fb(new Date(this.rb.getTime()));d.rb['set'+a](this.rb['get'+a]()+c.valueOf());return d},olympe.D.fb)}Ov(a){return this.Zf('Milliseconds',
327
+ a)}Tv(a){return this.Zf('Seconds',a)}Pv(a){return this.Zf('Minutes',a)}Nv(a){return this.Zf('Hours',a)}Am(a){return this.Zf('Date',a)}Uv(a){return'number'===typeof a?this.Am(7*a):this.Am(a.Dk(7))}Qv(a){return this.Zf('Month',a)}Vv(a){return this.Zf('FullYear',a)}Hy(){let a=this.rb.getDay();a=0===a?6:a-1;return new olympe.D.fb(new Date(this.rb.getFullYear(),this.rb.getMonth(),this.rb.getDate()-a))}Iy(){return new olympe.D.fb(new Date(this.rb.getFullYear(),this.rb.getMonth()))}Ad(a){return olympe.D.va([a],
328
+ b=>olympe.D.Xb(this.Ga(b)),olympe.D.fa)}Ga(a){return a instanceof olympe.D.fb?this.getTime()===a.getTime()||isNaN(this.getTime())&&isNaN(a.getTime()):!1}Xw(){let a=this.rb.getDay();0===a&&(a=7);return olympe.D.sa(a)}Pw(a,b){return olympe.D.va([a,b],(c,d)=>{d=d.valueOf();'years'===d?c=this.rb.getFullYear()-c.rb.getFullYear():'months'===d?c=12*(this.rb.getFullYear()-c.rb.getFullYear())+(this.rb.getMonth()-c.rb.getMonth()):(d={milliseconds:1,seconds:1E3,minutes:6E4,hours:36E5,days:864E5,weeks:6048E5}[d],
329
+ void 0===d&&(olympe.ma.hb('df').warn("[getDiff] '_unit' is not a valid unit! Defaulting to milliseconds"),d=1),c=Math.trunc((this.rb.getTime()-c.rb.getTime())/d));return olympe.D.sa(c)},olympe.D.ba)}Ix(a){return olympe.D.va([a],b=>olympe.D.Xb(this.getTime()<b.getTime()),olympe.D.fa)}Gx(a){return olympe.D.va([a],b=>olympe.D.Xb(this.getTime()>b.getTime()),olympe.D.fa)}Jx(a,b){return olympe.D.va([a,b],(c,d)=>olympe.D.Xb(this.getTime()>c.getTime()&&this.getTime()<d.getTime()),olympe.D.fa)}valueOf(){return this.$i().valueOf()?
330
+ new Date(this.getTime()):new Date(0)}};olympe.D.fb.C=Wb(0);olympe.D.fb.F=Wb(Number.NaN);m=olympe.D.fb.prototype;m.$i.L=olympe.D.J.O;m.Ft.L=olympe.D.J.G;m.Ht.L=olympe.D.J.G;m.Gt.L=olympe.D.J.G;m.Et.L=olympe.D.J.G;m.Lw.L=olympe.D.J.G;m.getMonth.L=olympe.D.J.G;m.It.L=olympe.D.J.G;m.getTime.L=olympe.D.J.C;m.Gy.L=new olympe.D.J(()=>olympe.D.Oa,[0]);m.toLocaleString.L=olympe.D.J.F;m.toLocaleDateString.L=olympe.D.J.F;m.toLocaleTimeString.L=olympe.D.J.F;m.Pc.L=olympe.D.J.F;m.Ky.L=olympe.D.J.C;
331
+ m.My.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Oy.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Zf.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Ov.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Tv.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Pv.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Nv.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Am.L=new olympe.D.J(()=>olympe.D.fb,[0]);m.Uv.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Qv.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Vv.L=new olympe.D.J(()=>olympe.D.fb,[0]);
332
+ m.Hy.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Iy.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Ad.L=olympe.D.J.O;m.Ga.L=olympe.D.J.C;m.Xw.L=olympe.D.J.G;m.Pw.L=new olympe.D.J(()=>olympe.D.ba,[0,1]);m.Ix.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.Gx.L=new olympe.D.J(()=>olympe.D.fa,[0]);m.Jx.L=new olympe.D.J(()=>olympe.D.fa,[0,1]);m.valueOf.L=olympe.D.J.C;const Xb=new Map,Yb=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,Zb=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;function $b(a){const b=c=>{let d;c=c.valueOf();6>c.length?(d=17,c=Zb.exec(c)):(d=1,c=Yb.exec(c));c=c?c.slice(1).map(e=>parseInt(e,16)*d):[0,0,0];return olympe.D.Color.create(c[0],c[1],c[2],isNaN(c[3])?1:c[3]/255)};return olympe.D.bf(a)?olympe.D.qe([a],b,olympe.D.Color):b(a)}
333
+ olympe.D.Color=class{constructor(a,b,c,d){this.C=olympe.D.sa(void 0!==a?Math.min(255,Math.max(0,Math.round(a))):0);this.F=olympe.D.sa(void 0!==b?Math.min(255,Math.max(0,Math.round(b))):0);this.b=olympe.D.sa(void 0!==c?Math.min(255,Math.max(0,Math.round(c))):0);this.a=olympe.D.sa(void 0!==d?Math.min(1,Math.max(0,d)):1)}toJSON(){return{r:this.C.valueOf(),g:this.F.valueOf(),b:this.b.valueOf(),a:this.a.valueOf()}}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return olympe.D.Color.create(b.r,
334
+ b.g,b.b,b.a)}static create(a,b,c,d=1){return olympe.D.va([a,b,c,d],(e,f,g,h)=>{e=olympe.D.sa(void 0!==e?Math.min(255,Math.max(0,Math.round(e.valueOf()))):0);f=olympe.D.sa(void 0!==f?Math.min(255,Math.max(0,Math.round(f.valueOf()))):0);g=olympe.D.sa(void 0!==g?Math.min(255,Math.max(0,Math.round(g.valueOf()))):0);h=olympe.D.sa(void 0!==h?Math.min(1,Math.max(0,h.valueOf())):1);for(let k of Xb.values())if(k&&k.C.Ga(e)&&k.F.Ga(f)&&k.b.Ga(g)&&k.a.Ga(h))return k;return new olympe.D.Color(e,f,g,h)},olympe.D.Color)}Sg(){return this.C}Mg(){return this.b}Pg(){return this.F}Lg(){return this.a}$v(a,
335
+ b){return olympe.D.Color.create(this.C.bj(a.Sg(),b),this.F.bj(a.Pg(),b),this.b.bj(a.Mg(),b),this.a.bj(a.Lg(),b))}rw(a){return olympe.D.Color.create(this.C,this.F,this.b,a)}ns(){return`rgba(${this.C},${this.F},${this.b},${this.a})`}mn(){const a=(16777216|this.b|this.F<<8|this.C<<16).toString(16).slice(1),b=1===this.a.valueOf()?'':(256|255*this.a).toString(16).slice(1);return'#'+(a+b).toUpperCase()}toString(){return this.mn()}Ga(a){return a instanceof olympe.D.Color?this.C.valueOf()===a.C.valueOf()&&
336
+ this.F.valueOf()===a.F.valueOf()&&this.b.valueOf()===a.b.valueOf()&&this.a.valueOf()===a.a.valueOf():!1}compare(a){const b=(this.Sg().valueOf()<<16|this.Pg().valueOf()<<8|this.Mg().valueOf())-(a.Sg().valueOf()<<16|a.Pg().valueOf()<<8|a.Mg().valueOf());return 0===b?this.Lg().valueOf()-a.Lg().valueOf():b}};olympe.D.Color.prototype.equals=olympe.D.Color.prototype.Ga;olympe.D.Color.prototype.toHexString=olympe.D.Color.prototype.mn;olympe.D.Color.prototype.toRGBString=olympe.D.Color.prototype.ns;
337
+ olympe.D.Color.prototype.getAlpha=olympe.D.Color.prototype.Lg;olympe.D.Color.prototype.getGreen=olympe.D.Color.prototype.Pg;olympe.D.Color.prototype.getBlue=olympe.D.Color.prototype.Mg;olympe.D.Color.prototype.getRed=olympe.D.Color.prototype.Sg;olympe.D.Color.create=olympe.D.Color.create;m=olympe.D.Color.prototype;m.toJSON.L=olympe.D.J.C;m.Sg.L=olympe.D.J.G;m.Mg.L=olympe.D.J.G;m.Pg.L=olympe.D.J.G;m.Lg.L=olympe.D.J.G;m.$v.L=new olympe.D.J(()=>olympe.D.Color,[]);
338
+ m.rw.L=new olympe.D.J(()=>olympe.D.Color,[]);m.ns.L=new olympe.D.J(()=>String,[]);m.mn.L=new olympe.D.J(()=>String,[]);m.Ga.L=olympe.D.J.C;m.compare.L=olympe.D.J.C;olympe.D.File=class{na(){}up(){}vp(){}Rr(){}rk(){}Om(){}sk(){}rename(){}};olympe.D.Ub=class{constructor(a,b){this.x=olympe.D.Yd(a);this.y=olympe.D.Yd(b)}toJSON(){return'{ "type": "vector2", "x": '+JSON.stringify(olympe.D.Ma(this.x).valueOf())+', "y": '+JSON.stringify(olympe.D.Ma(this.y).valueOf())+' }'}static Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.D.Ub(b.x,b.y)}wp(){return this.x}Ey(a){Tb(this.x,a)}xp(){return this.y}Fy(a){Tb(this.y,a)}tx(){return this.x.hs(this.y)}Zd(a){return olympe.D.va([this,a],(b,c)=>new olympe.D.Ub(b.x.Zd(c.x),b.y.Zd(c.y)),
339
+ olympe.D.Ub,'Vector2.plus')}Yg(a){return olympe.D.va([this,a],(b,c)=>new olympe.D.Ub(b.x.Yg(c.x),b.y.Yg(c.y)),olympe.D.Ub,'Vector2.minus')}Xx(a){return new olympe.D.Ub(this.x.Dk(a),this.y.Dk(a))}mw(a){return new olympe.D.Ub(this.x.Ri(a),this.y.Ri(a))}Zx(){return new olympe.D.Ub(this.x.hj(),this.y.hj())}nw(a){return olympe.D.va([this,a],(b,c)=>olympe.D.va([b.x,b.y,c.x,c.y],(d,e,f,g)=>olympe.D.sa(d*f+e*g),olympe.D.ba),olympe.D.ba)}length(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.sa(Math.sqrt(a*
340
+ a+b*b)),olympe.D.ba)}normalize(){return olympe.D.va([this.x,this.y],(a,b)=>{const c=Math.sqrt(a*a+b*b);return new olympe.D.Ub(a/c,b/c)},olympe.D.Ub)}floor(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.Ub(Math.floor(a),Math.floor(b)),olympe.D.Ub)}ceil(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.Ub(Math.ceil(a),Math.ceil(b)),olympe.D.Ub)}round(){return olympe.D.va([this.x,this.y],(a,b)=>new olympe.D.Ub(Math.round(a),Math.round(b)),olympe.D.Ub)}Rv(a){return new olympe.D.Ub(this.x.Zd(a),
341
+ this.y.Zd(a))}Sv(a,b){return new olympe.D.Ub(this.x.Zd(a),this.y.Zd(b))}Pc(){return olympe.D.va([this.x,this.y],(a,b)=>olympe.D.Ab(`Vector2[${a.valueOf()}, ${b.valueOf()}]`),olympe.D.Oa)}toString(){return`Vector2[${this.x.Da.Eb}, ${this.y.Da.Eb}]`}Ga(a){return this===a?!0:!1}};m=olympe.D.Ub.prototype;m.toJSON.L=olympe.D.J.C;m.wp.L=olympe.D.J.G;m.Ey.L=olympe.D.J.C;m.xp.L=olympe.D.J.G;m.Fy.L=olympe.D.J.C;m.tx.L=olympe.D.J.G;m.Zd.L=new olympe.D.J(()=>olympe.D.Ub,[0]);
342
+ m.Yg.L=new olympe.D.J(()=>olympe.D.Ub,[0]);m.Xx.L=olympe.D.J.T;m.mw.L=olympe.D.J.T;m.Zx.L=olympe.D.J.T;m.nw.L=new olympe.D.J(()=>olympe.D.ba,[0]);m.length.L=olympe.D.J.G;m.normalize.L=olympe.D.J.T;m.floor.L=olympe.D.J.T;m.ceil.L=olympe.D.J.T;m.round.L=olympe.D.J.T;m.Rv.L=olympe.D.J.T;m.Sv.L=olympe.D.J.T;m.Pc.L=olympe.D.J.F;m.toString.L=olympe.D.J.C;m.Ga.L=olympe.D.J.C;olympe.D.pg=class{constructor(){}Nb(){}Hd(){}get(){}Qh(){}has(){}Vg(){}Gc(){}Df(){}lf(){}bg(){}forEach(){}ge(){}};olympe.D.pg.prototype.forEachCurrentValue=olympe.D.pg.prototype.ge;olympe.D.pg.prototype.forEach=olympe.D.pg.prototype.forEach;m=olympe.D.pg.prototype;m.has.L=olympe.D.J.O;m.Vg.L=olympe.D.J.C;m.Gc.L=new olympe.D.J(()=>Object,[]);m.Df.L=new olympe.D.J(()=>String,[]);m.lf.L=olympe.D.J.G;m.bg.L=olympe.D.J.C;m.forEach.L=new olympe.D.J(()=>{},[]);m.ge.L=olympe.D.J.C;olympe.D.ld=class extends olympe.D.pg{Wd(){}Cf(){}$e(){}Bf(){}he(){}Ze(){}Si(){}Sh(){}};olympe.D.ld.prototype.getCurrentAt=olympe.D.ld.prototype.Ze;olympe.D.ld.prototype.getAt=olympe.D.ld.prototype.he;olympe.D.ld.prototype.getCurrentKeyAt=olympe.D.ld.prototype.Bf;olympe.D.ld.prototype.getKeyAt=olympe.D.ld.prototype.$e;olympe.D.ld.prototype.getCurrentRank=olympe.D.ld.prototype.Cf;olympe.D.ld.prototype.getRank=olympe.D.ld.prototype.Wd;m=olympe.D.ld.prototype;m.Wd.L=olympe.D.J.G;m.Cf.L=olympe.D.J.C;
343
+ m.$e.L=new olympe.D.J(()=>String,[]);m.Bf.L=olympe.D.J.C;m.he.L=new olympe.D.J(()=>Object,[]);m.Ze.L=olympe.D.J.C;m.Si.L=olympe.D.J.C;m.Sh.L=new olympe.D.J(()=>Array,[]);olympe.D.Yh=class{constructor(a,b){this.O=b||olympe.D.$a();this.valueType=a||Object;this.values={};this.kb=this.ua=null;this.De=0;this.Z=Object.create(null);this.vb=Object.create(null);this.size=0;this.K=null;this.O.onDestroy(()=>{const c=this.Z;if(c){const d=Object.keys(c),e=d.length;for(let f=0;f<e;f++){const g=c[d[f]],h=Object.keys(g);for(let k=h.length,l=0;l<k;l++)g[h[l]].destroy()}}})}getContext(){return this.O}Nb(){return this.valueType}Hd(a){this.valueType=a;const b=this.ua;if(null!==b)for(const c in b)Object.prototype.hasOwnProperty.call(b,
344
+ c)&&Pb(b[c],a)}get(a){const b=c=>{null===this.ua&&(this.ua={});return this.Vi(this.ua,c,this.values[c],this.valueType,'Map.get('+c+')')};return olympe.D.va([a],c=>b(c),this.valueType)}Qh(a){a=this.values[a];return olympe.D.ib(a)?Ab(a.Da)?a.Da.Eb:void 0:a}has(a){const b=c=>{null===this.kb&&(this.kb={});return this.Vi(this.kb,c,c in this.values?olympe.D.fa.F:olympe.D.fa.C,olympe.D.fa,'Map.has('+c+')')};return olympe.D.va([a],c=>b(c),olympe.D.fa)}Vg(a){return a in this.values}Vi(a,b,c,d,e){let f=a[b];
345
+ f||this.O.run(()=>{f=olympe.D.Md(d,void 0,e);a[b]=f;f.Da.onDestroy(()=>delete a[b]);olympe.D.ib(c)?Sb(f,c):Qb(f,c)});return f}Gc(){throw Error('Abstract method getFirstKey needs to be overridden');}Df(){throw Error('Abstract method getFirstKey needs to be overridden');}lf(){null===this.K&&this.O.run(()=>{this.K=olympe.D.Md(olympe.D.ba,olympe.D.sa(this.size));this.K.Da.onDestroy(()=>{this.K=null})});return this.K}bg(){return this.size}forEach(a,b){const c=this.wm();a=this.tr(c,a,b);this.vm(c,a)}wm(){return String(++this.De)}vm(a,
346
+ b){this.vb[a]=b;olympe.D.$a().Z(()=>{const c=this.Z;for(const d in c)Object.prototype.hasOwnProperty.call(c,d)&&delete c[d][a];delete this.vb[a]});this.ge(b)}tr(a,b,c){const d=olympe.D.$a();return(e,f)=>{d.run(()=>{const g=olympe.D.createNode(void 0,b,null,[e,f,this],null,`forEach-${a}-${f}`);if(void 0!==c)g.onDestroy(()=>{c(f)});this.zm(a,f,g)})}}zm(a,b,c){void 0===this.Z[b]&&(this.Z[b]={});this.Z[b][a]=c}ge(a){const b=this.values;for(const c in b)if(Object.prototype.hasOwnProperty.call(b,c)&&!1===
347
347
  a(b[c],c,this))break}jk(a,b){void 0!==this.values[a]&&this.Ni(a,!0);this.values[a]=b;var c=this.ua;null!==c&&void 0!==c[a]&&(b&&b instanceof olympe.D.Proxy?Sb(c[a],b):Qb(c[a],b));c=this.kb;null!==c&&void 0!==c[a]&&Tb(c[a],!0);this.size++;c=this.vb;for(const d in c)if(Object.prototype.hasOwnProperty.call(c,d))c[d](b,a,this)}Ni(a,b){const c=this.values;if(Object.prototype.hasOwnProperty.call(c,a)){var d=(d=c[a])&&d.Kg?d.Da.Eb:d;var e=this.ua;null!==e&&void 0!==e[a]&&Rb(e[a]);e=this.kb;null!==e&&void 0!==
348
- e[a]&&Tb(e[a],!1);delete c[a];this.size--;b||this.wf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}wf(){null!==this.J&&Tb(this.J,this.size)}Fh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Rb(a[c]);a=this.kb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&Tb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
349
- c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.J&&Tb(this.J,this.size)}sg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.Xh.ya=[olympe.D.pg];m=olympe.D.Xh.prototype;m.getContext.L=olympe.D.K.C;m.Nb.L=olympe.D.K.C;m.Hd.L=olympe.D.K.C;m.get.L=new olympe.D.K(()=>Object,[],'valueType');m.Ph.L=olympe.D.K.C;m.has.L=olympe.D.K.O;m.Vg.L=olympe.D.K.C;m.Vi.L=olympe.D.K.C;
350
- m.lf.L=olympe.D.K.G;m.bg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.wm.L=olympe.D.K.C;m.vm.L=olympe.D.K.C;m.sr.L=olympe.D.K.C;m.zm.L=olympe.D.K.C;m.he.L=olympe.D.K.C;m.jk.L=olympe.D.K.C;m.Ni.L=olympe.D.K.C;m.wf.L=olympe.D.K.C;m.Fh.L=olympe.D.K.C;m.sg.L=olympe.D.K.C;olympe.D.kj=class extends olympe.D.Xh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.ka=this.Fa=this.ab=this.ea=null}Hd(a){super.Hd(a);if(null!==this.ka)for(let b of this.ka.values())Pb(b,a)}Gc(){return this.ie(0)}Cf(){return this.$e(0)}Wd(a){const b=c=>{null===this.ab&&(this.ab=Object.create(null));let d=this.Bf(a);d=void 0!==d?olympe.D.sa(d):void 0;return this.Vi(this.ab,c,d,olympe.D.ba,`List.getRank(${c})`)};return olympe.D.hb(a)?L(olympe.D.createNode(olympe.D.ba,b,null,
351
- [a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}Bf(a){return this.F[a]}$e(a){const b=c=>{const d=c.valueOf(),e=this.Af(d);null===this.Fa&&(this.Fa=Object.create(null));return this.Vi(this.Fa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.va([a],c=>b(c),String)}Af(a){return this.C[a.valueOf()]}ie(a){if(olympe.D.hb(a))return this.get(olympe.D.va([a],c=>{c=this.$e(c);if(!Ab(c.Da)){const d=olympe.D.$a();olympe.D.Ff(d)&&Kb(d)}return c},String));null===this.ka&&(this.ka=new Map);let b=this.ka.get(a);
352
- b||this.O.run(()=>{b=this.get(this.$e(a));this.ka.set(a,b);b.Da.onDestroy(()=>this.ka.delete(a))});return b}Ze(a){return this.Ph(this.Af(a))}Si(a,b,c,d){let e=this.wm();a=this.$r(e,a,b,c,d);this.vm(e,a)}$r(a,b,c,d,e){return olympe.D.$a().G((f,g)=>{let h=!1,k=olympe.D.Vh([b,c,this.Wd(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.zm(a,g,k)})}Rh(){null===this.ea&&this.O.run(()=>{this.ea=olympe.D.Md(Array,this.C.filter(a=>void 0!==a));
353
- this.ea.Da.onDestroy(()=>{this.J=null})});return this.ea}he(a){if(this.C.length!==this.size)super.he(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}ym(a,b){const c=this.ab,d=this.Fa,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&Rb(c[g]),void 0!==
354
- c[a]&&Qb(c[a],olympe.D.sa(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Rb(d[e]),void 0!==d[b]&&Qb(d[b],a))}}xm(a){var b=this.Fa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Da.Eb===a&&Rb(b));delete this.F[a];this.C.splice(c,1);c=this.ab;null!==c&&void 0!==c[a]&&Rb(c[a])}tr(){if(null!==this.ea){const a=this.C,b=this.ea.Da.Eb;b&&a.join(',')!==b.join(',')&&Qb(this.ea,a)}}wf(){this.tr();super.wf()}Fh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.ab;if(null!==
355
- a)for(b in a)Rb(a[b]);a=this.Fa;if(null!==a)for(b in a)Rb(a[parseInt(b,10)]);var b=this.ea;null!==b&&(Ib(b.Da),Qb(b,this.C));return olympe.D.Xh.prototype.Fh.call(this)}sg(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.kj.ya=[olympe.D.ld];m=olympe.D.kj.prototype;m.Hd.L=olympe.D.K.C;m.Gc.L=new olympe.D.K(()=>Object,[]);m.Cf.L=new olympe.D.K(()=>String,[]);m.Wd.L=olympe.D.K.G;m.Bf.L=olympe.D.K.C;
356
- m.$e.L=new olympe.D.K(()=>String,[]);m.Af.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>Object,[]);m.Ze.L=olympe.D.K.C;m.Si.L=new olympe.D.K(()=>{},[]);m.$r.L=olympe.D.K.C;m.Rh.L=new olympe.D.K(()=>Array,[]);m.he.L=olympe.D.K.C;m.ym.L=olympe.D.K.C;m.xm.L=olympe.D.K.C;m.tr.L=olympe.D.K.C;m.wf.L=olympe.D.K.C;m.Fh.L=olympe.D.K.C;m.sg.L=olympe.D.K.C;olympe.D.Map=class extends olympe.D.Xh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Hd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&Pb(this.F,a);super.Hd(a)}Gc(){null===this.F&&this.Im();return this.F}Cf(){null===this.C&&this.Im();return this.C}Im(){this.getContext().run(()=>{this.F=olympe.D.Md(this.Nb());this.C=olympe.D.Md(String);this.fj(this.Lm())})}Lm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}fj(a){if(void 0!==
357
- a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Sb(this.F,b):Qb(this.F,b);Qb(this.C,a)}else void 0!==this.F.Da.Eb&&(Rb(this.F),Rb(this.C))}set(a,b){this.jk(a,b);1===this.size&&null!==this.C&&this.fj(a);this.wf()}remove(a){const b=this.Ni(a);null!==this.C&&this.C.Da.Eb===a&&this.fj(this.Lm());return b}clear(){this.Fh();null!==this.C&&this.fj()}};m=olympe.D.Map.prototype;m.Hd.L=olympe.D.K.C;m.Gc.L=new olympe.D.K(()=>Object,[]);m.Cf.L=new olympe.D.K(()=>String,[]);m.Im.L=olympe.D.K.C;
358
- m.Lm.L=olympe.D.K.C;m.fj.L=olympe.D.K.C;m.set.L=olympe.D.K.C;m.remove.L=new olympe.D.K(()=>Object,[]);m.clear.L=olympe.D.K.C;olympe.D.vg=class extends olympe.D.kj{constructor(a){super(a)}set(a,b,c){this.jk(a,b);void 0!==c&&olympe.D.Nc([c],d=>{this.ym(a,d)});this.wf()}remove(a){this.xm(a);return this.Ni(a)}clear(){this.Fh()}};olympe.D.vg.prototype.remove.L=olympe.D.K.C;olympe.D.vg.prototype.clear.L=olympe.D.K.C;olympe.D.xs=class extends olympe.D.zj{constructor(a,b){super(olympe.D.ba,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ba.Ao.Dp}tb(){return olympe.D.$x(this.node,this.duration,this.C,void 0)}};let ac=null;olympe.D.H=void 0;olympe.D.gn=void 0;olympe.D.Kh=void 0;olympe.D.Eh=new Map;olympe.D.Eh.set(0,olympe.D.ba.ZERO);olympe.D.Eh.set(1,olympe.D.ba.ONE);olympe.D.Eh.set(2,olympe.D.ba.wv);olympe.D.ik=new Map;olympe.D.ik.set('',olympe.D.Oa.EMPTY);olympe.D.ik.set(' ',olympe.D.Oa.gv);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Cd:b,If:c,Wm:d,debug:g,$f:e,md:f,Oi:h})};olympe.D.Ff=function(a){return a instanceof olympe.D.Node};
359
- olympe.D.Md=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Ff(b)?Lb(a,b):olympe.D.hb(b)?Lb(a,b.Da):K(a,b);return L(a)};olympe.D.hb=function(a){return!(!a||!a.Kg)};olympe.D.bf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Kg))};olympe.D.$m=function(a){return a instanceof olympe.D.Zb||a instanceof olympe.D.Jq||a instanceof olympe.D.Node};olympe.D.Wg=function(a){return a instanceof olympe.D.zj};
360
- olympe.D.dn=function(a,b){if(void 0!==a){olympe.D.Wg(a)&&(a=a.tb().Da);if(!olympe.D.bf(a))return b(a);var c=[];olympe.D.hb(a)?c.push(a.Da):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ma=function(a,b){let c=a;olympe.D.hb(a)?c=a.Da.Eb:olympe.D.Ff(a)?c=a.Eb:olympe.D.Wg(a)&&(c=a.tb().Da.Eb);return void 0===c?b:c};
361
- olympe.D.$g=function(a,b){let c;olympe.D.hb(a)?c=a.Da:olympe.D.Ff(a)?c=a:olympe.D.Wg(a)&&(c=a.tb().Da);c&&olympe.D.Nc([b],d=>{c.$g(d)},'setDefaultValue');return a};olympe.D.Vh=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.qr?(h=h.Da,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.Wg(h)&&(h=h.tb().Da,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
362
- olympe.D.re=function(a,b,c,d){return L(olympe.D.Vh(a,b,c,d||'syncProxies'))};const bc=a=>{for(const b of a)if(olympe.D.bf(b)||olympe.D.Wg(b))return!1;return!0};olympe.D.va=function(a,b,c,d,e){if(bc(a))return b(...a);const f=olympe.D.Vh(a,b,c,d||'TransformFlows');e&&olympe.D.Nc([e],g=>{f.$g(g)},'setDefaultValue');return L(f)};olympe.D.Nc=function(a,b,c){bc(a)?b(...a):olympe.D.Vh(a,b,void 0,c||'processFlows')};
363
- olympe.D.mD=function(a,b,c){const d=olympe.D.Ff(a)?a.Nb():olympe.D.Wg(a)?a.tb().Dh:a.Dh,e=olympe.D.ic(d,c),f=olympe.Y.Promise.nk(g=>{e.getContext().eb()||e.update(g)},b);olympe.D.Nc([a],g=>f(g).then());return e.tb()};olympe.D.cs=function(a,b){if(bc(a))b(...a);else{const c=olympe.D.$a();olympe.D.Vh(a,(...d)=>{olympe.D.$a().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
364
- olympe.D.en=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.hb(g)?(g=g.Da,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.Wg(g)&&(g=g.tb().Da,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Cd:b,Wm:e,$f:f,uy:!1,md:c})};olympe.D.ds=function(a,b){const c=olympe.D.$a();olympe.D.en(a,(...d)=>{olympe.D.$a().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.D.kD=function(a,b,c){a=new olympe.D.zj(a,c);b(a);return a.tb()};
365
- olympe.D.ic=function(a,b='flowSource'){return new olympe.D.zj(a,b)};olympe.D.SD=function(a,b,c,d){const e=olympe.D.$a();olympe.D.Vh(a,(...f)=>{olympe.D.$a().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.D.Zi=function(a,b,c){olympe.D.va([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.xD=function(a,b,c='from observable'){const d=olympe.D.ic(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
366
- olympe.D.uD=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.WD=function(a){return olympe.D.$a().G(a)};olympe.D.rD=function(a,b,c){olympe.D.nw(a?a.Da:a,b,c)};
367
- olympe.D.nw=function(a,b,c){if(a){var d=a.V();null===ac&&(ac={});if(ac[d])olympe.D.H.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{ac[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.H.warn(e):olympe.D.H.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.H.log(f,'undefined'):null===g?olympe.D.H.log(f,'null'):olympe.D.H.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.H.log(`Node #${d} destroyed`+(b?`: ${b}`:
368
- ''))});c.onDestroy(()=>{delete ac[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.qD=function(){let a='',b=olympe.D.$a();for(;null!==b;)a+=b.ad()+' --\x3e ',b=b.getParent();olympe.D.H.log(a)};
369
- olympe.D.sa=function(a){if(void 0===a)return olympe.D.ba.ZERO;if(a instanceof olympe.D.ba)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ba.Kp;if(a===Math.PI)return olympe.D.ba.PI;if(Infinity===a)return olympe.D.ba.wt;if(-Infinity===a)return olympe.D.ba.qu;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Eh.has(a)||olympe.D.Eh.set(a,new olympe.D.ba(a)),olympe.D.Eh.get(a)):new olympe.D.ba(a)}return null};
370
- olympe.D.Yd=function(a){return void 0===a?olympe.D.Md(olympe.D.ba):olympe.D.Md(olympe.D.ba,olympe.D.bf(a)?a:olympe.D.sa(a))};olympe.D.$x=olympe.D.ba.animate;olympe.D.HD=function(a,b){return new olympe.D.xs(a,b)};olympe.D.Ab=function(a){if(a instanceof olympe.D.Oa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.ik.has(a)?olympe.D.ik.get(a):new olympe.D.Oa(a)};
371
- olympe.D.MD=function(a){return void 0===a?olympe.D.Md(olympe.D.Oa):olympe.D.Md(olympe.D.Oa,olympe.D.bf(a)?a:olympe.D.Ab(a))};olympe.D.Xb=function(a){return a instanceof olympe.D.fa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C};olympe.D.JD=function(a){return void 0===a?olympe.D.Md(olympe.D.fa):olympe.D.Md(olympe.D.fa,olympe.D.bf(a)?a:olympe.D.Xb(a))};olympe.D.ID=function(a){if(a instanceof Date)return new olympe.D.ib(a)};
372
- olympe.D.LD=function(a){return olympe.D.Md(olympe.D.ib,void 0!==a?new olympe.D.ib(a):null)};olympe.D.Wr=a=>a instanceof olympe.D.fa||a instanceof olympe.D.ba||a instanceof olympe.D.Oa||a instanceof olympe.D.ib;olympe.D.ND=function(a,b){return olympe.D.Md(olympe.D.Tb,void 0===a&&void 0===b?void 0:new olympe.D.Tb(a,b))};olympe.D.ny=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Md(olympe.D.Color,e)};olympe.D.KD=olympe.D.ny;
373
- olympe.D.ew=function(a){olympe.D.H=a;olympe.D.Kh=olympe.D.Og()};olympe.D.Og=function(){olympe.D.gn||(olympe.D.gn=new olympe.D.Jq);return olympe.D.gn};olympe.D.$a=function(){olympe.D.Kh||(olympe.D.Kh=olympe.D.Og());return olympe.D.Kh};olympe.D.js=function(a){const b=olympe.D.Kh;olympe.D.$m(a)&&(olympe.D.Kh=a);return null!=b?b:null};
374
- olympe.D.Vb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.ib.Vb(a);break;case 'number':b=olympe.D.ba.Vb(a);break;case 'string':b=olympe.D.Oa.Vb(a);break;case 'vector2':b=olympe.D.Tb.Vb(a);break;case 'color':b=olympe.D.Color.Vb(a);break;case 'boolean':b=olympe.D.fa.Vb(a)}return b}return null};function cc(a){a.C.eb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.J.length=0)}
375
- olympe.D.KB=class{constructor(){this.C=new olympe.D.Zb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ic(dc,'Last slot manager entry');this.size=Ub(olympe.D.ic(olympe.D.ba,'SlotManager size').repeat(this.F.tb().Qm()),olympe.D.ba.ZERO);this.O=Ub(olympe.D.ic(olympe.D.ba,'last valid slots'),olympe.D.sa(-1))});this.T=[];this.J=[];this.C.onDestroy(()=>{cc(this)})}};
376
- class dc{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Zb('Slot manager entry');this.J=c;this.O=d;this.F.run(()=>{const e=Ub(olympe.D.ic(olympe.D.ba),olympe.D.ba.ZERO);olympe.D.hb(b)?e.repeat(b):e.update(b);this.C=olympe.D.ic(olympe.D.ba);this.G=this.C.tb().Zd(e.tb())});this.next=null}V(){return this.id}wx(){return this.C.tb()}Qm(){return this.G}Wd(){return this.J}Gx(){return this.O}Py(a){this.J=a}Cy(a){null===a?this.C.update(olympe.D.ba.ZERO):(this.C.repeat(a.Qm()),a.next=this)}It(){this.C.clear();
377
- this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=dc.prototype;m.V.L=olympe.D.K.C;m.wx.L=new olympe.D.K(()=>olympe.D.ba);m.Qm.L=new olympe.D.K(()=>olympe.D.ba);m.Wd.L=olympe.D.K.C;m.Gx.L=olympe.D.K.C;m.Py.L=olympe.D.K.C;m.Cy.L=olympe.D.K.C;m.It.L=olympe.D.K.C;m.destroy.L=olympe.D.K.C;olympe.D.R={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.D.U.Lp,Number.POSITIVE_INFINITY);E(a,olympe.D.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('df'))},'olympe.df');olympe.W.run([olympe.D.R.Ca],a=>{olympe.D.ew(a)},'olympe.df');olympe.host={};const ec=new Map,fc=new Map;olympe.host.Pp=class{static register(a,b,...c){ec.set(a,b);0<c.length&&fc.set(a,c)}static create(a,b,c,d){const e=ec.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=fc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ia(d,f))):new e(b,c)}};function gc(a,b,c){a.H.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Pp.create(c,b,a.H,a.J))}function hc(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.H.Z()<=olympe.ma.Hb.C.Mf&&a.H.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.hb(f))b.push(a.C.get(f.Kv)||null);else if('function'===typeof f){const g=f,h=olympe.D.$a();b.push((...k)=>{h.eb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
378
- function ic(a){var b=olympe.host.Ce.ud,c=olympe.host.Ce.Op.gr;++a.G;const d=a.G;gc(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.hb(p)?(h.push(n),p=p.Da):olympe.D.Ff(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{hc(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
379
- {hc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.Z(a.O.bind(a,d));a=L(e);a.Kv=d;K(e,a);return a}olympe.host.Sa=class{constructor(a,b){this.H=a;this.J=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}gb(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Id=class{constructor(a){this.C=a;this.F=olympe.D.$a()}G(){return this.C}od(){return this.C.Da.od()||this.F.od()}eb(){return this.C.Da.eb()}};olympe.host.Id.prototype.G.L=new olympe.D.K(()=>olympe.host.Ce.Id,[]);olympe.host.ek=class{C(){}F(){}};olympe.host.qt=class{F(){}C(){return v(function*(){})}$i(){}};function jc(a,b){var c=olympe.host.Jf;const d=olympe.Y.Mc(),e=new olympe.D.Zb('onTimeout context');c.C.Z(b,d,()=>{e.eb()||e.od()||e.run(a);c.C.G(d)});return new olympe.host.ud.F(c.C,d,e)}function kc(a,b){var c=olympe.host.Jf;const d=olympe.Y.Mc(),e=new olympe.D.Zb('onInterval context');c.C.T(b,d,()=>{e.eb()||e.od()?c.C.F(d):e.run(a)})}olympe.host.ud=class{constructor(a){this.C=ic(a)}};olympe.host.ud.C=class{constructor(a,b,c){this.Jf=a;this.id=b;this.C=null!=c?c:null}V(){return this.id}cancel(){}};
380
- olympe.host.ud.J=class extends olympe.host.ud.C{cancel(){this.Jf.O(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.F=class extends olympe.host.ud.C{cancel(){this.Jf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.G=class extends olympe.host.ud.C{cancel(){this.Jf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Pj=class{F(a,b){return null!=b?b:''}aa(a,b){return null!=b?b:''}O(){}C(a,b){return null!=b?b:''}G(){}};olympe.host.Ce={};olympe.host.Ce.Id=class{destroy(){}};olympe.host.Ce.Id.prototype.destroy=olympe.host.Ce.Id.prototype.destroy;olympe.host.Ce.Op={Wy:100,Yy:101,Xy:102,$y:103,Zy:104,Vy:105,BB:201,zB:202,wB:204,EB:205,vB:206,yB:207,CB:208,FB:209,GB:210,HB:211,xB:212,DB:218,AB:219,IB:220,uB:221,tB:222,PB:300,QB:301,RB:302,VB:303,WB:304,XB:305,SB:310,TB:311,UB:312,WA:400,XA:401,YA:402,MA:450,FA:500,DA:501,IA:502,HA:503,EA:504,GA:505,pC:600,gC:601,kC:602,cC:603,dC:604,aC:605,fC:606,vC:607,nC:608,YB:609,bC:610,eC:611,mC:612,rC:613,ZB:614,qC:615,lC:616,uC:617,hC:618,iC:619,jC:620,oC:630,$B:631,sC:632,tC:633,$C:700,DC:701,EC:702,
381
- FC:703,HC:704,IC:705,JC:706,GC:707,LC:708,KC:709,MC:710,QC:711,YC:712,NC:713,OC:714,RC:715,SC:716,UC:717,VC:718,XC:719,TC:720,WC:721,ZC:722,PC:723,aD:724,bD:725,gr:800};olympe.host.Ce.ud=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={ak:'host.System',tl:'host.HistoryManager',Lq:'host.Scheduler',Ca:'host.platform.Logger',Ea:'host.Manager',Qe:'host.ProcessManager'};olympe.host.U={iq:'host.processProbe',Qq:'host.gracefulShutdownTimeout'};olympe.host.Jf=null;
382
- olympe.W.config(function(a){Ma(a,olympe.host.R.ak);Ma(a,olympe.host.R.tl);D(a,olympe.host.R.Qe,olympe.host.Pj);E(a,olympe.host.R.Ca,[olympe.ma.R.Ea],function(b){return b.Wc('host')});D(a,olympe.host.R.Ea,olympe.host.Sa,olympe.host.R.Ca,olympe.W.R.kg);E(a,olympe.host.R.Lq,[olympe.host.R.Ea],b=>{null===olympe.host.Jf&&(olympe.host.Jf=new olympe.host.ud(b));return olympe.host.Jf},!0)},'olympe.host');olympe.W.run([olympe.host.R.Lq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.R.Ea],a=>a,'olympe.host');
383
- olympe.W.run([olympe.host.R.Qe],a=>{olympe.host.vk=()=>a});olympe.net={};olympe.net.Ba={};olympe.net.Ba.Sd={th:'POST',GET:'GET',nt:'HEAD',jq:'PUT',Cc:'DELETE',Yp:'OPTIONS',ZA:'PATCH'};olympe.net.Ba.ResponseType={mm:'text',Tk:'blob',Ji:'arraybuffer'};olympe.net.Ba.Headers={bi:'content-type',kz:'content-length',Dn:'authorization',ws:'access-control-allow-origin',us:'access-control-allow-headers',vs:'access-control-allow-methods',Oo:'x-forwarded-host',Po:'x-forwarded-proto'};olympe.net.Ba.fl={nA:'text/html',JSON:'application/json',Jv:'application/zip',Wf:'application/octet-stream'};
384
- olympe.net.Ba.$b={Fs:0,rh:200,Yn:201,ij:202,Rk:400,zv:401,Mo:403,Ml:404,JA:405,Bi:500,$u:503};function lc(a){return a.host&&encodeURI(a.host)}function mc(a){return encodeURI(a.path).replace(olympe.net.Mi.C,(b,c)=>'%'+c)}function nc(a){return void 0===a.G?443===a.port:a.G}olympe.net.Mi=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${nc(this)?'wss':'ws'}://${lc(this)}:${this.port}/${mc(this)}`}toString(){return`${lc(this)}:${this.port}/${mc(this)}`}};
385
- olympe.net.Mi.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}aa(){}Z(){}F(){}};function N(a,b,c,d){a=olympe.Y.oy(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.ki(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.ns&&(c=a.ns.split(':'),2===c.length&&(c=Ta(olympe.Y.Ye(),`${c[0]}:${c[1]}`),oc(b,{Authorization:`Basic ${c}`})));return b}function pc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function oc(a,b){Object.assign(a.headers,b)}
386
- olympe.net.ki=class extends olympe.net.Mi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Ba.Sd.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.Ba.ResponseType.mm;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Wi(){return this.headers}C(){let a=pc(this);a=a?`?${a}`:'';return lc(this)?`${nc(this)?'https':'http'}://${lc(this)}:${this.port}/${mc(this)}${a}`:`${mc(this)}${a}`}toString(){return this.C()}};
387
- olympe.net.ki.Sd={th:'POST',GET:'GET',nt:'HEAD',jq:'PUT',Cc:'DELETE',Yp:'OPTIONS'};olympe.net.ae=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Hc(){return this.status}Wi(){return this.headers}};function qc(a,b,c){const d=olympe.D.$a(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.Hf(e);a.F().C.delete(b);c(f)})}function rc(a,b){return new olympe.net.nf(a,b)}olympe.net.Sa=class{constructor(a){this.H=a;this.J=1;a='Initializing NET layer';this.H.C()&&(a+=' (implementation: '+this.T()+')');this.H.info(a);this.H.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}cg(){}T(){}};function sc(a){let b;return!(null==(b=a.C)||!b.connected)}function tc(a,b){const c=()=>{const d=b(),e=d.wd();return{username:`${a.T.vhost}:${d.Ac()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
348
+ e[a]&&Tb(e[a],!1);delete c[a];this.size--;b||this.xf()}a=this.Z[a];if(void 0!==a)for(const f in a)Object.prototype.hasOwnProperty.call(a,f)&&a[f].destroy();return d}xf(){null!==this.K&&Tb(this.K,this.size)}Gh(){var a=this.ua;if(null!==a)for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&Rb(a[c]);a=this.kb;if(null!==a)for(var b in a)Object.prototype.hasOwnProperty.call(a,b)&&Tb(a[b],!1);for(const c in this.values)Object.prototype.hasOwnProperty.call(this.values,c)&&delete this.values[c];for(const c in this.Z)if(Object.prototype.hasOwnProperty.call(this.Z,
349
+ c)){b=this.Z[c];for(const d in b)Object.prototype.hasOwnProperty.call(b,d)&&b[d].destroy()}this.size=0;null!==this.K&&Tb(this.K,this.size)}sg(){const a=this.values;let b='\n';for(const c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b+=a[c]+'\n');return b}};olympe.D.Yh.ya=[olympe.D.pg];m=olympe.D.Yh.prototype;m.getContext.L=olympe.D.J.C;m.Nb.L=olympe.D.J.C;m.Hd.L=olympe.D.J.C;m.get.L=new olympe.D.J(()=>Object,[],'valueType');m.Qh.L=olympe.D.J.C;m.has.L=olympe.D.J.O;m.Vg.L=olympe.D.J.C;m.Vi.L=olympe.D.J.C;
350
+ m.lf.L=olympe.D.J.G;m.bg.L=olympe.D.J.C;m.forEach.L=new olympe.D.J(()=>{},[]);m.wm.L=olympe.D.J.C;m.vm.L=olympe.D.J.C;m.tr.L=olympe.D.J.C;m.zm.L=olympe.D.J.C;m.ge.L=olympe.D.J.C;m.jk.L=olympe.D.J.C;m.Ni.L=olympe.D.J.C;m.xf.L=olympe.D.J.C;m.Gh.L=olympe.D.J.C;m.sg.L=olympe.D.J.C;olympe.D.kj=class extends olympe.D.Yh{constructor(a,b){super(a,b);this.F=Object.create(null);this.C=[];this.ka=this.Fa=this.ab=this.ea=null}Hd(a){super.Hd(a);if(null!==this.ka)for(let b of this.ka.values())Pb(b,a)}Gc(){return this.he(0)}Df(){return this.$e(0)}Wd(a){const b=c=>{null===this.ab&&(this.ab=Object.create(null));let d=this.Cf(a);d=void 0!==d?olympe.D.sa(d):void 0;return this.Vi(this.ab,c,d,olympe.D.ba,`List.getRank(${c})`)};return olympe.D.ib(a)?L(olympe.D.createNode(olympe.D.ba,b,null,
351
+ [a.Da],[0],'onResolved('+(b.name||'')+')')):b(a)}Cf(a){return this.F[a]}$e(a){const b=c=>{const d=c.valueOf(),e=this.Bf(d);null===this.Fa&&(this.Fa=Object.create(null));return this.Vi(this.Fa,String(d),e,String,'List.getKeyAt('+c+')')};return olympe.D.va([a],c=>b(c),String)}Bf(a){return this.C[a.valueOf()]}he(a){if(olympe.D.ib(a))return this.get(olympe.D.va([a],c=>{c=this.$e(c);if(!Ab(c.Da)){const d=olympe.D.$a();olympe.D.Gf(d)&&Kb(d)}return c},String));null===this.ka&&(this.ka=new Map);let b=this.ka.get(a);
352
+ b||this.O.run(()=>{b=this.get(this.$e(a));this.ka.set(a,b);b.Da.onDestroy(()=>this.ka.delete(a))});return b}Ze(a){return this.Qh(this.Bf(a))}Si(a,b,c,d){let e=this.wm();a=this.bs(e,a,b,c,d);this.vm(e,a)}bs(a,b,c,d,e){return olympe.D.$a().G((f,g)=>{let h=!1,k=olympe.D.Wh([b,c,this.Wd(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.zm(a,g,k)})}Sh(){null===this.ea&&this.O.run(()=>{this.ea=olympe.D.Md(Array,this.C.filter(a=>void 0!==a));
353
+ this.ea.Da.onDestroy(()=>{this.K=null})});return this.ea}ge(a){if(this.C.length!==this.size)super.ge(a);else{var b=this.values;for(let c of this.C.filter(d=>void 0!==d))if(Object.prototype.hasOwnProperty.call(b,c)&&!1===a(b[c],c,this))break}}ym(a,b){const c=this.ab,d=this.Fa,e=this.F[a],f=b.valueOf();if(e!==f||this.C[e]!==a){var g=this.C[f];void 0!==g&&delete this.F[g];void 0!==e&&null!==e&&this.C[e]===a&&(this.C[e]=void 0);this.F[a]=f;this.C[f]=a;null!==c&&(void 0!==g&&void 0!==c[g]&&Rb(c[g]),void 0!==
354
+ c[a]&&Qb(c[a],olympe.D.sa(f)));null!==d&&(void 0!==e&&null!==e&&void 0!==d[e]&&Rb(d[e]),void 0!==d[b]&&Qb(d[b],a))}}xm(a){var b=this.Fa,c=this.F[a];null!==c&&void 0!==c&&null!==b&&(b=b[c],void 0!==b&&b.Da.Eb===a&&Rb(b));delete this.F[a];this.C.splice(c,1);c=this.ab;null!==c&&void 0!==c[a]&&Rb(c[a])}ur(){if(null!==this.ea){const a=this.C,b=this.ea.Da.Eb;b&&a.join(',')!==b.join(',')&&Qb(this.ea,a)}}xf(){this.ur();super.xf()}Gh(){var a=this.F;for(b in a)delete a[b];this.C.length=0;a=this.ab;if(null!==
355
+ a)for(b in a)Rb(a[b]);a=this.Fa;if(null!==a)for(b in a)Rb(a[parseInt(b,10)]);var b=this.ea;null!==b&&(Ib(b.Da),Qb(b,this.C));return olympe.D.Yh.prototype.Gh.call(this)}sg(){const a=this.values,b=this.F;let c='[\n';for(let d in a)Object.prototype.hasOwnProperty.call(a,d)&&(c+=`${b[d]}. ${a[d]}\n`);return c+']'}};olympe.D.kj.ya=[olympe.D.ld];m=olympe.D.kj.prototype;m.Hd.L=olympe.D.J.C;m.Gc.L=new olympe.D.J(()=>Object,[]);m.Df.L=new olympe.D.J(()=>String,[]);m.Wd.L=olympe.D.J.G;m.Cf.L=olympe.D.J.C;
356
+ m.$e.L=new olympe.D.J(()=>String,[]);m.Bf.L=olympe.D.J.C;m.he.L=new olympe.D.J(()=>Object,[]);m.Ze.L=olympe.D.J.C;m.Si.L=new olympe.D.J(()=>{},[]);m.bs.L=olympe.D.J.C;m.Sh.L=new olympe.D.J(()=>Array,[]);m.ge.L=olympe.D.J.C;m.ym.L=olympe.D.J.C;m.xm.L=olympe.D.J.C;m.ur.L=olympe.D.J.C;m.xf.L=olympe.D.J.C;m.Gh.L=olympe.D.J.C;m.sg.L=olympe.D.J.C;olympe.D.Map=class extends olympe.D.Yh{constructor(a){a===olympe.D.Proxy&&(a=Object);super(a);this.C=this.F=null}Hd(a){a===olympe.D.Proxy&&(a=Object);null!==this.F&&Pb(this.F,a);super.Hd(a)}Gc(){null===this.F&&this.Im();return this.F}Df(){null===this.C&&this.Im();return this.C}Im(){this.getContext().run(()=>{this.F=olympe.D.Md(this.Nb());this.C=olympe.D.Md(String);this.fj(this.Lm())})}Lm(){const a=this.values;let b,c;for(b in a)if(Object.prototype.hasOwnProperty.call(a,b)){c=b;break}return c}fj(a){if(void 0!==
357
+ a){const b=this.values[a];b&&b instanceof olympe.D.Proxy?Sb(this.F,b):Qb(this.F,b);Qb(this.C,a)}else void 0!==this.F.Da.Eb&&(Rb(this.F),Rb(this.C))}set(a,b){this.jk(a,b);1===this.size&&null!==this.C&&this.fj(a);this.xf()}remove(a){const b=this.Ni(a);null!==this.C&&this.C.Da.Eb===a&&this.fj(this.Lm());return b}clear(){this.Gh();null!==this.C&&this.fj()}};m=olympe.D.Map.prototype;m.Hd.L=olympe.D.J.C;m.Gc.L=new olympe.D.J(()=>Object,[]);m.Df.L=new olympe.D.J(()=>String,[]);m.Im.L=olympe.D.J.C;
358
+ m.Lm.L=olympe.D.J.C;m.fj.L=olympe.D.J.C;m.set.L=olympe.D.J.C;m.remove.L=new olympe.D.J(()=>Object,[]);m.clear.L=olympe.D.J.C;olympe.D.vg=class extends olympe.D.kj{constructor(a){super(a)}set(a,b,c){this.jk(a,b);void 0!==c&&olympe.D.Oc([c],d=>{this.ym(a,d)});this.xf()}remove(a){this.xm(a);return this.Ni(a)}clear(){this.Gh()}};olympe.D.vg.prototype.remove.L=olympe.D.J.C;olympe.D.vg.prototype.clear.L=olympe.D.J.C;olympe.D.ys=class extends olympe.D.zj{constructor(a,b){super(olympe.D.ba,'animatedFlowSource');this.duration=a;this.C=b||olympe.D.ba.Ao.Ep}tb(){return olympe.D.ay(this.node,this.duration,this.C,void 0)}};let ac=null;olympe.D.H=void 0;olympe.D.gn=void 0;olympe.D.Lh=void 0;olympe.D.Fh=new Map;olympe.D.Fh.set(0,olympe.D.ba.ZERO);olympe.D.Fh.set(1,olympe.D.ba.ONE);olympe.D.Fh.set(2,olympe.D.ba.xv);olympe.D.ik=new Map;olympe.D.ik.set('',olympe.D.Oa.EMPTY);olympe.D.ik.set(' ',olympe.D.Oa.hv);olympe.D.createNode=function(a,b,c,d,e,f,g,h){return new olympe.D.Node({valueType:a,Cd:b,Jf:c,Wm:d,debug:g,$f:e,md:f,Oi:h})};olympe.D.Gf=function(a){return a instanceof olympe.D.Node};
359
+ olympe.D.Md=function(a,b,c){a=olympe.D.createNode(a,void 0,void 0,void 0,void 0,c);olympe.D.Gf(b)?Lb(a,b):olympe.D.ib(b)?Lb(a,b.Da):K(a,b);return L(a)};olympe.D.ib=function(a){return!(!a||!a.Kg)};olympe.D.bf=function(a){return!(!a||!(a instanceof olympe.D.Node||a.Kg))};olympe.D.$m=function(a){return a instanceof olympe.D.Zb||a instanceof olympe.D.Kq||a instanceof olympe.D.Node};olympe.D.Wg=function(a){return a instanceof olympe.D.zj};
360
+ olympe.D.dn=function(a,b){if(void 0!==a){olympe.D.Wg(a)&&(a=a.tb().Da);if(!olympe.D.bf(a))return b(a);var c=[];olympe.D.ib(a)?c.push(a.Da):c.push(a);return olympe.D.createNode(void 0,b,null,c,[0],'onResolved')}};olympe.D.Ma=function(a,b){let c=a;olympe.D.ib(a)?c=a.Da.Eb:olympe.D.Gf(a)?c=a.Eb:olympe.D.Wg(a)&&(c=a.tb().Da.Eb);return void 0===c?b:c};
361
+ olympe.D.$g=function(a,b){let c;olympe.D.ib(a)?c=a.Da:olympe.D.Gf(a)?c=a:olympe.D.Wg(a)&&(c=a.tb().Da);c&&olympe.D.Oc([b],d=>{c.$g(d)},'setDefaultValue');return a};olympe.D.Wh=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.rr?(h=h.Da,g.push(k)):h instanceof olympe.D.Node?g.push(k):olympe.D.Wg(h)&&(h=h.tb().Da,g.push(k))),f[k]=h;return olympe.D.createNode(c,b,null,f,g,d||'syncNodes')};
362
+ olympe.D.qe=function(a,b,c,d){return L(olympe.D.Wh(a,b,c,d||'syncProxies'))};const bc=a=>{for(const b of a)if(olympe.D.bf(b)||olympe.D.Wg(b))return!1;return!0};olympe.D.va=function(a,b,c,d,e){if(bc(a))return b(...a);const f=olympe.D.Wh(a,b,c,d||'TransformFlows');e&&olympe.D.Oc([e],g=>{f.$g(g)},'setDefaultValue');return L(f)};olympe.D.Oc=function(a,b,c){bc(a)?b(...a):olympe.D.Wh(a,b,void 0,c||'processFlows')};
363
+ olympe.D.nD=function(a,b,c){const d=olympe.D.Gf(a)?a.Nb():olympe.D.Wg(a)?a.tb().Eh:a.Eh,e=olympe.D.ic(d,c),f=olympe.Y.Promise.nk(g=>{e.getContext().eb()||e.update(g)},b);olympe.D.Oc([a],g=>f(g).then());return e.tb()};olympe.D.ds=function(a,b){if(bc(a))b(...a);else{const c=olympe.D.$a();olympe.D.Wh(a,(...d)=>{olympe.D.$a().destroy();c.run(b,...d)},void 0,'processFlowsOnce')}};
364
+ olympe.D.en=function(a,b,c){const d=a.length,e=Array(d),f=[];let g;for(let h=0;h<d;h++)g=a[h],void 0!==g&&null!==g&&(olympe.D.ib(g)?(g=g.Da,f.push(h)):g instanceof olympe.D.Node?f.push(h):olympe.D.Wg(g)&&(g=g.tb().Da,f.push(h))),e[h]=g;0!==f.length&&new olympe.D.Node({Cd:b,Wm:e,$f:f,vy:!1,md:c})};olympe.D.es=function(a,b){const c=olympe.D.$a();olympe.D.en(a,(...d)=>{olympe.D.$a().destroy();c.run(b,...d)},'processFutureFlowsOnce')};olympe.D.lD=function(a,b,c){a=new olympe.D.zj(a,c);b(a);return a.tb()};
365
+ olympe.D.ic=function(a,b='flowSource'){return new olympe.D.zj(a,b)};olympe.D.TD=function(a,b,c,d){const e=olympe.D.$a();olympe.D.Wh(a,(...f)=>{olympe.D.$a().destroy();e.run(b,...f)},c,d||'syncProxiesOnce')};olympe.D.Zi=function(a,b,c){olympe.D.va([a],d=>d.valueOf()?b.apply(null,void 0):c&&c.apply(null,void 0),Object,'If')};olympe.D.yD=function(a,b,c='from observable'){const d=olympe.D.ic(b,c),e=a.subscribe(f=>d.update(f));d.getContext().onDestroy(()=>e.unsubscribe());return d.tb()};
366
+ olympe.D.vD=function(a,b,...c){return a?a.run(b,...c):b(...c)};olympe.D.XD=function(a){return olympe.D.$a().G(a)};olympe.D.sD=function(a,b,c){olympe.D.ow(a?a.Da:a,b,c)};
367
+ olympe.D.ow=function(a,b,c){if(a){var d=a.V();null===ac&&(ac={});if(ac[d])olympe.D.H.log(`Already started node #${d} dump`+(b?`: ${b}`:''));else{ac[d]=!0;var e=`Starting node #${d} dump`+(b?`: ${b}`:'');c?olympe.D.H.warn(e):olympe.D.H.log(e);var f=`#${d}`+(b?`: ${b}`:'')+':';c=olympe.D.createNode(null,g=>{void 0===g?olympe.D.H.log(f,'undefined'):null===g?olympe.D.H.log(f,'null'):olympe.D.H.log(f,String(g))},null,[a],[0],'DataFlowDump');a.onDestroy(()=>{olympe.D.H.log(`Node #${d} destroyed`+(b?`: ${b}`:
368
+ ''))});c.onDestroy(()=>{delete ac[d]})}}else olympe.D.H.log('NOT starting node dump, node is '+String(a))};olympe.D.rD=function(){let a='',b=olympe.D.$a();for(;null!==b;)a+=b.ad()+' --\x3e ',b=b.getParent();olympe.D.H.log(a)};
369
+ olympe.D.sa=function(a){if(void 0===a)return olympe.D.ba.ZERO;if(a instanceof olympe.D.ba)return a;a&&a.valueOf&&(a=a.valueOf());if('number'===typeof a){if(isNaN(a))return olympe.D.ba.Lp;if(a===Math.PI)return olympe.D.ba.PI;if(Infinity===a)return olympe.D.ba.xt;if(-Infinity===a)return olympe.D.ba.ru;if(isNaN(a))var b=!1;else b=parseFloat(a),b=(b|0)===b;return b&&-1<=a&&100>=a?(olympe.D.Fh.has(a)||olympe.D.Fh.set(a,new olympe.D.ba(a)),olympe.D.Fh.get(a)):new olympe.D.ba(a)}return null};
370
+ olympe.D.Yd=function(a){return void 0===a?olympe.D.Md(olympe.D.ba):olympe.D.Md(olympe.D.ba,olympe.D.bf(a)?a:olympe.D.sa(a))};olympe.D.ay=olympe.D.ba.animate;olympe.D.ID=function(a,b){return new olympe.D.ys(a,b)};olympe.D.Ab=function(a){if(a instanceof olympe.D.Oa)return a;a instanceof Object&&(a=a.valueOf());const b=typeof a;if('string'===b||'number'===b||'boolean'===b)return a=String(a),olympe.D.ik.has(a)?olympe.D.ik.get(a):new olympe.D.Oa(a)};
371
+ olympe.D.ND=function(a){return void 0===a?olympe.D.Md(olympe.D.Oa):olympe.D.Md(olympe.D.Oa,olympe.D.bf(a)?a:olympe.D.Ab(a))};olympe.D.Xb=function(a){return a instanceof olympe.D.fa?a:void 0!==a&&null!==a&&a.valueOf()?olympe.D.fa.F:olympe.D.fa.C};olympe.D.KD=function(a){return void 0===a?olympe.D.Md(olympe.D.fa):olympe.D.Md(olympe.D.fa,olympe.D.bf(a)?a:olympe.D.Xb(a))};olympe.D.JD=function(a){if(a instanceof Date)return new olympe.D.fb(a)};
372
+ olympe.D.MD=function(a){return olympe.D.Md(olympe.D.fb,void 0!==a?new olympe.D.fb(a):null)};olympe.D.Xr=a=>a instanceof olympe.D.fa||a instanceof olympe.D.ba||a instanceof olympe.D.Oa||a instanceof olympe.D.fb;olympe.D.OD=function(a,b){return olympe.D.Md(olympe.D.Ub,void 0===a&&void 0===b?void 0:new olympe.D.Ub(a,b))};olympe.D.oy=function(a,b,c,d){let e;void 0!==a&&(a instanceof olympe.D.Color?e=a:e=olympe.D.Color.create(a,b,c,d));return olympe.D.Md(olympe.D.Color,e)};olympe.D.LD=olympe.D.oy;
373
+ olympe.D.fw=function(a){olympe.D.H=a;olympe.D.Lh=olympe.D.Og()};olympe.D.Og=function(){olympe.D.gn||(olympe.D.gn=new olympe.D.Kq);return olympe.D.gn};olympe.D.$a=function(){olympe.D.Lh||(olympe.D.Lh=olympe.D.Og());return olympe.D.Lh};olympe.D.ks=function(a){const b=olympe.D.Lh;olympe.D.$m(a)&&(olympe.D.Lh=a);return null!=b?b:null};
374
+ olympe.D.Qb=a=>{a='string'===typeof a?JSON.parse(a):a;if(a.type){let b=null;switch(a.type){case 'dateTime':b=olympe.D.fb.Qb(a);break;case 'number':b=olympe.D.ba.Qb(a);break;case 'string':b=olympe.D.Oa.Qb(a);break;case 'vector2':b=olympe.D.Ub.Qb(a);break;case 'color':b=olympe.D.Color.Qb(a);break;case 'boolean':b=olympe.D.fa.Qb(a)}return b}return null};function cc(a){a.C.eb()||(a.G.forEach(b=>{b.destroy()}),a.G.clear(),a.F.clear(),a.size.clear(),a.O.clear(),a.T.length=0,a.K.length=0)}
375
+ olympe.D.LB=class{constructor(){this.C=new olympe.D.Zb('Slot Manager context');this.G=new Map;this.C.run(()=>{this.F=olympe.D.ic(dc,'Last slot manager entry');this.size=Ub(olympe.D.ic(olympe.D.ba,'SlotManager size').repeat(this.F.tb().Qm()),olympe.D.ba.ZERO);this.O=Ub(olympe.D.ic(olympe.D.ba,'last valid slots'),olympe.D.sa(-1))});this.T=[];this.K=[];this.C.onDestroy(()=>{cc(this)})}};
376
+ class dc{constructor(a,b,c,d){this.id=a;this.F=new olympe.D.Zb('Slot manager entry');this.K=c;this.O=d;this.F.run(()=>{const e=Ub(olympe.D.ic(olympe.D.ba),olympe.D.ba.ZERO);olympe.D.ib(b)?e.repeat(b):e.update(b);this.C=olympe.D.ic(olympe.D.ba);this.G=this.C.tb().Zd(e.tb())});this.next=null}V(){return this.id}xx(){return this.C.tb()}Qm(){return this.G}Wd(){return this.K}Hx(){return this.O}Qy(a){this.K=a}Dy(a){null===a?this.C.update(olympe.D.ba.ZERO):(this.C.repeat(a.Qm()),a.next=this)}Jt(){this.C.clear();
377
+ this.next=null}destroy(){this.F.destroy();this.G=this.C=this.next=null}}m=dc.prototype;m.V.L=olympe.D.J.C;m.xx.L=new olympe.D.J(()=>olympe.D.ba);m.Qm.L=new olympe.D.J(()=>olympe.D.ba);m.Wd.L=olympe.D.J.C;m.Hx.L=olympe.D.J.C;m.Qy.L=olympe.D.J.C;m.Dy.L=olympe.D.J.C;m.Jt.L=olympe.D.J.C;m.destroy.L=olympe.D.J.C;olympe.D.R={Ca:'df.Logger'};olympe.W.config(a=>{F(a,olympe.D.U.Mp,Number.POSITIVE_INFINITY);E(a,olympe.D.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('df'))},'olympe.df');olympe.W.run([olympe.D.R.Ca],a=>{olympe.D.fw(a)},'olympe.df');olympe.host={};const ec=new Map,fc=new Map;olympe.host.Qp=class{static register(a,b,...c){ec.set(a,b);0<c.length&&fc.set(a,c)}static create(a,b,c,d){const e=ec.get(a);if(void 0===e)throw Error('Undefined UI element type: '+a);a=fc.get(a);return void 0!==a?new e(b,c,...a.map(f=>Ia(d,f))):new e(b,c)}};function gc(a,b,c){a.H.debug('CREATE #',b,', type=',c);a.C.set(b,olympe.host.Qp.create(c,b,a.H,a.K))}function hc(a,b,c,...d){const e=a.C.get(b);if(void 0!==e){a.H.O()<=olympe.ma.Fb.C.Nf&&a.H.debug('CALL #'+b+', '+c+'('+Array.prototype.slice.call(d,0)+')');b=[];for(const f of d)if(void 0===f||null===f)b.push(f);else if(olympe.D.ib(f))b.push(a.C.get(f.Lv)||null);else if('function'===typeof f){const g=f,h=olympe.D.$a();b.push((...k)=>{h.eb()||g(...k)})}else b.push(f.valueOf());e[c].apply(e,b)}}
378
+ function ic(a){var b=olympe.host.Ce.ud,c=olympe.host.Ce.Pp.hr;++a.G;const d=a.G;gc(a,d,c);const e=olympe.D.createNode(b,void 0,void 0,void 0,void 0,'Native('+d+')',!1,function(){var f=arguments.length-2;const g=Array.from({length:f}),h=[],k=arguments[f+1],l=d+'_'+k;this.F.has(l)&&this.F.get(l).destroy();for(let n=0;n<f;n++){let p=arguments[n];olympe.D.ib(p)?(h.push(n),p=p.Da):olympe.D.Gf(p)&&h.push(n);g[n]=p}0===h.length?e.run(()=>{hc(this,d,k,...g)}):(f=olympe.D.createNode(void 0,(...n)=>{e.run(()=>
379
+ {hc(this,d,k,...n)})},void 0,g,h,'Native('+d+').'+k),this.F.set(l,f),f.onDestroy(()=>this.F.delete(l)));return null}.bind(a));e.Z(a.O.bind(a,d));a=L(e);a.Lv=d;K(e,a);return a}olympe.host.Sa=class{constructor(a,b){this.H=a;this.K=b;this.G=0;this.C=new Map;this.F=new Map;a.debug('Starting host manager')}hb(){return this.H}O(a){this.H.debug('DESTROY #',a);const b=this.C.get(a);this.C.delete(a);b.destroy()}};olympe.host.Id=class{constructor(a){this.C=a;this.F=olympe.D.$a()}G(){return this.C}od(){return this.C.Da.od()||this.F.od()}eb(){return this.C.Da.eb()}};olympe.host.Id.prototype.G.L=new olympe.D.J(()=>olympe.host.Ce.Id,[]);olympe.host.ek=class{C(){}F(){}};olympe.host.rt=class{F(){}C(){return v(function*(){})}$i(){}};function jc(a,b){var c=olympe.host.Kf;const d=olympe.Y.Nc(),e=new olympe.D.Zb('onTimeout context');c.C.Z(b,d,()=>{e.eb()||e.od()||e.run(a);c.C.G(d)});return new olympe.host.ud.F(c.C,d,e)}function kc(a,b){var c=olympe.host.Kf;const d=olympe.Y.Nc(),e=new olympe.D.Zb('onInterval context');c.C.T(b,d,()=>{e.eb()||e.od()?c.C.F(d):e.run(a)})}olympe.host.ud=class{constructor(a){this.C=ic(a)}};olympe.host.ud.C=class{constructor(a,b,c){this.Kf=a;this.id=b;this.C=null!=c?c:null}V(){return this.id}cancel(){}};
380
+ olympe.host.ud.K=class extends olympe.host.ud.C{cancel(){this.Kf.O(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.F=class extends olympe.host.ud.C{cancel(){this.Kf.G(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.ud.G=class extends olympe.host.ud.C{cancel(){this.Kf.F(this.id);let a;null==(a=this.C)||a.destroy();this.C=null}};olympe.host.Pj=class{F(a,b){return null!=b?b:''}aa(a,b){return null!=b?b:''}O(){}C(a,b){return null!=b?b:''}G(){}};olympe.host.Ce={};olympe.host.Ce.Id=class{destroy(){}};olympe.host.Ce.Id.prototype.destroy=olympe.host.Ce.Id.prototype.destroy;olympe.host.Ce.Pp={Xy:100,Zy:101,Yy:102,az:103,$y:104,Wy:105,CB:201,AB:202,xB:204,FB:205,wB:206,zB:207,DB:208,GB:209,HB:210,IB:211,yB:212,EB:218,BB:219,JB:220,vB:221,uB:222,QB:300,RB:301,SB:302,WB:303,XB:304,YB:305,TB:310,UB:311,VB:312,XA:400,YA:401,ZA:402,NA:450,GA:500,EA:501,JA:502,IA:503,FA:504,HA:505,qC:600,hC:601,lC:602,dC:603,eC:604,bC:605,gC:606,wC:607,oC:608,ZB:609,cC:610,fC:611,nC:612,sC:613,$B:614,rC:615,mC:616,vC:617,iC:618,jC:619,kC:620,pC:630,aC:631,tC:632,uC:633,aD:700,EC:701,FC:702,
381
+ GC:703,IC:704,JC:705,KC:706,HC:707,MC:708,LC:709,NC:710,RC:711,ZC:712,OC:713,PC:714,SC:715,TC:716,VC:717,WC:718,YC:719,UC:720,XC:721,$C:722,QC:723,bD:724,cD:725,hr:800};olympe.host.Ce.ud=class{O(){}Z(){}G(){}T(){}F(){}};olympe.host.R={ak:'host.System',tl:'host.HistoryManager',Mq:'host.Scheduler',Ca:'host.platform.Logger',Ea:'host.Manager',Qe:'host.ProcessManager'};olympe.host.U={jq:'host.processProbe',Rq:'host.gracefulShutdownTimeout'};olympe.host.Kf=null;
382
+ olympe.W.config(function(a){Ma(a,olympe.host.R.ak);Ma(a,olympe.host.R.tl);D(a,olympe.host.R.Qe,olympe.host.Pj);E(a,olympe.host.R.Ca,[olympe.ma.R.Ea],function(b){return b.Wc('host')});D(a,olympe.host.R.Ea,olympe.host.Sa,olympe.host.R.Ca,olympe.W.R.kg);E(a,olympe.host.R.Mq,[olympe.host.R.Ea],b=>{null===olympe.host.Kf&&(olympe.host.Kf=new olympe.host.ud(b));return olympe.host.Kf},!0)},'olympe.host');olympe.W.run([olympe.host.R.Mq],a=>a,'olympe.host.scheduler');olympe.W.run([olympe.host.R.Ea],a=>a,'olympe.host');
383
+ olympe.W.run([olympe.host.R.Qe],a=>{olympe.host.vk=()=>a});olympe.net={};olympe.net.Ba={};olympe.net.Ba.Sd={uh:'POST',GET:'GET',ot:'HEAD',kq:'PUT',Dc:'DELETE',Zp:'OPTIONS',$A:'PATCH'};olympe.net.Ba.ResponseType={mm:'text',Tk:'blob',Ji:'arraybuffer'};olympe.net.Ba.Headers={ci:'content-type',lz:'content-length',Dn:'authorization',xs:'access-control-allow-origin',vs:'access-control-allow-headers',ws:'access-control-allow-methods',Oo:'x-forwarded-host',Po:'x-forwarded-proto'};olympe.net.Ba.fl={oA:'text/html',JSON:'application/json',Kv:'application/zip',Wf:'application/octet-stream'};
384
+ olympe.net.Ba.$b={Gs:0,rh:200,Yn:201,ij:202,Rk:400,Av:401,Mo:403,Ml:404,KA:405,Bi:500,av:503};function lc(a){return a.host&&encodeURI(a.host)}function mc(a){return encodeURI(a.path).replace(olympe.net.Mi.C,(b,c)=>'%'+c)}function nc(a){return void 0===a.G?443===a.port:a.G}olympe.net.Mi=class{constructor(a,b,c,d){this.host='localhost';this.port=80;this.path='';this.G=!1;void 0!==a&&(this.host=a);void 0!==b&&(this.port=b);void 0!==c&&(this.path=c.replace(/^\/+/,''));void 0!==d&&(this.G=d)}C(){return`${nc(this)?'wss':'ws'}://${lc(this)}:${this.port}/${mc(this)}`}toString(){return`${lc(this)}:${this.port}/${mc(this)}`}};
385
+ olympe.net.Mi.C=/%25([0-9a-f]{2})/i;olympe.net.WebSocket=class{send(){}close(){}ea(){}aa(){}Z(){}F(){}};function N(a,b,c,d){a=olympe.Y.py(a.valueOf());if(!a.host&&!a.path)return null;const e=a.scheme?a.scheme.includes('s'):!1;b=new olympe.net.li(a.host,a.port||(e?443:80),a.path||'',e,b,c,d,a.query||void 0);a.ps&&(c=a.ps.split(':'),2===c.length&&(c=Ta(olympe.Y.Ye(),`${c[0]}:${c[1]}`),oc(b,{Authorization:`Basic ${c}`})));return b}function pc(a){return void 0!==a.query?a.query.replace(/[^=&]+/g,b=>encodeURIComponent(b)):null}function oc(a,b){Object.assign(a.headers,b)}
386
+ olympe.net.li=class extends olympe.net.Mi{constructor(a,b,c,d,e,f,g,h){super(a,b,c,d);this.method=void 0!==e?e:olympe.net.Ba.Sd.GET;this.query=h;this.headers={};this.body=f;this.F=void 0!==g?g:olympe.net.Ba.ResponseType.mm;this.ca=this.cert=this.key=null;this.rejectUnauthorized=!1}Wi(){return this.headers}C(){let a=pc(this);a=a?`?${a}`:'';if(!lc(this))return`${mc(this)}${a}`;const b=Number.isInteger(this.port)?`:${this.port}`:'';return`${nc(this)?'https':'http'}://${lc(this)}${b}/${mc(this)}${a}`}toString(){return this.C()}};
387
+ olympe.net.li.Sd={uh:'POST',GET:'GET',ot:'HEAD',kq:'PUT',Dc:'DELETE',Zp:'OPTIONS'};olympe.net.ae=class{constructor(a,b,c,d){this.data=a;this.status=void 0===b?200:b;this.statusText=void 0===c?'':c;this.headers=void 0===d?{}:d}getData(){return this.data}Hc(){return this.status}Wi(){return this.headers}};function qc(a,b,c){const d=olympe.D.$a(),e=d.onDestroy(()=>{var f=a.F();const g=f.C.get(b);g&&(f.C.delete(b),g())});return d.G(f=>{d.If(e);a.F().C.delete(b);c(f)})}function rc(a,b){return new olympe.net.nf(a,b)}olympe.net.Sa=class{constructor(a){this.H=a;this.K=1;a='Initializing NET layer';this.H.C()&&(a+=' (implementation: '+this.T()+')');this.H.info(a);this.H.log('DONE initializing NET layer (ready to receive connection requests)')}F(){}G(){}C(){}O(){}cg(){}T(){}};function sc(a){let b;return!(null==(b=a.C)||!b.connected)}function tc(a,b){const c=()=>{const d=b(),e=d.wd();return{username:`${a.T.vhost}:${d.Bc()}`,password:e}};return Object.assign({},a.T,c(),{transformWsUrl:(d,e,f)=>{Object.assign(f.options,c());return d}})}
388
388
  function uc(a,b,c){if(!sc(a))return Promise.reject(Error('Cannot subscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT subscribe to topic ${b}`);return new Promise((d,e)=>{a.C.subscribe(b,void 0,f=>{f?e(Error(`Failed to subscribe to topic ${b}: ${f}`)):(a.F.set(b,c),d())})})}
389
- function vc(a,b){if(!sc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.C.unsubscribe(b,void 0,e=>{a.F.delete(b);e?d(e):c()})})}function wc(a,b){a.J.push(b)}function xc(a,b){a.G.push(b)}function yc(a,b){a.O.push(b)}
390
- olympe.net.nf=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.O=[];this.aa=[];this.Z=[];this.J=[];this.F=new Map;this.H=olympe.ma.gb('MQTT')}connect(a,b){if(sc(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,tc(this,a)),this.C.on(olympe.net.nf.C.pu,(c,d)=>{this.H.C()&&this.H.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.H.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.nf.C.Ls,
391
- ()=>{this.H.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.nf.C.Qu,()=>{this.H.info('Mqtt client is reconnecting to bus ... ');this.O.forEach(c=>c())}),this.C.on(olympe.net.nf.C.zb,c=>{this.H.error('Mqtt client error ',c);this.Z.forEach(d=>d(c))}),this.C.on(olympe.net.nf.C.de,()=>{this.H.info('Mqtt client is offline');this.aa.forEach(c=>c())}),this.C.on(olympe.net.nf.C.Ks,()=>{this.H.info('Mqtt client is closed');this.J.forEach(c=>c())}),this.C.on(olympe.net.nf.C.Qf,
389
+ function vc(a,b){if(!sc(a))return Promise.reject(Error('Cannot unsubscribe because the MQTT client is disconnected'));a.H.C()&&a.H.debug(`MQTT unsubscribe topic ${b}`);return new Promise((c,d)=>{a.C.unsubscribe(b,void 0,e=>{a.F.delete(b);e?d(e):c()})})}function wc(a,b){a.K.push(b)}function xc(a,b){a.G.push(b)}function yc(a,b){a.O.push(b)}
390
+ olympe.net.nf=class{constructor(a,b){this.url=a;this.T=b||null;this.C=null;this.G=[];this.O=[];this.aa=[];this.Z=[];this.K=[];this.F=new Map;this.H=olympe.ma.hb('MQTT')}connect(a,b){if(sc(this))return b&&b(),this;b&&this.G.push(b);null===this.C&&(this.C=mqtt.connect(this.url,tc(this,a)),this.C.on(olympe.net.nf.C.qu,(c,d)=>{this.H.C()&&this.H.debug(`MQTT < ${d}`);this.F.has(c)?this.F.get(c)(JSON.parse(d.toString())):this.H.warn('There is no subscriber for topic '+c)}),this.C.on(olympe.net.nf.C.Ms,
391
+ ()=>{this.H.info('Mqtt client is connected to bus');this.G.forEach(c=>c())}),this.C.on(olympe.net.nf.C.Ru,()=>{this.H.info('Mqtt client is reconnecting to bus ... ');this.O.forEach(c=>c())}),this.C.on(olympe.net.nf.C.zb,c=>{this.H.error('Mqtt client error ',c);this.Z.forEach(d=>d(c))}),this.C.on(olympe.net.nf.C.de,()=>{this.H.info('Mqtt client is offline');this.aa.forEach(c=>c())}),this.C.on(olympe.net.nf.C.Ls,()=>{this.H.info('Mqtt client is closed');this.K.forEach(c=>c())}),this.C.on(olympe.net.nf.C.Rf,
392
392
  ()=>{this.H.info('Mqtt client has ended')}));return this}publish(a,b,c){if(!sc(this))return Promise.reject(Error('Cannot publish message because the MQTT client is disconnected'));const d=JSON.stringify(b);this.H.C()&&this.H.debug(`MQTT > ${d}`);return new Promise((e,f)=>{this.C.publish(a,d,c,g=>{g?f(Error('Failed to publish a message '+d)):e()})})}end(a,b){this.F.clear();this.C?this.C.end(a,{},()=>{b&&b();this.C=null}):null==b||b();return this}};
393
- olympe.net.nf.C={Ls:'connect',Qu:'reconnect',pu:'message',Ks:'close',Qf:'end',zb:'error',de:'offline'};olympe.net.Li=class{constructor(a){this.H=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}G(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}J(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
394
- olympe.net.Li.C='*';olympe.net.kv=class{register(){return v(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.R={Ea:'net.Manager',Ca:'net.Logger',Ki:'net.WebServer',bv:'net.ServiceWorkerManager',Pl:'net.OfflineConfig'};olympe.net.U={ii:'net.httpPort',fp:'net.httpBodyLimit',fr:'net.http2',ep:'net.httpsCertificatesPath',Dj:'net.localNetworkSuffix',xi:'offline.enabled',Ol:'offline.autoBackOnline',Xp:'offline.downloadBatchSize'};
395
- olympe.W.config(function(a){F(a,olympe.net.U.ii,3141);F(a,olympe.net.U.fp,100);F(a,olympe.net.U.fr,!1);F(a,olympe.net.U.ep,null);F(a,olympe.net.U.Dj,'frontend');F(a,olympe.net.U.xi,!1);F(a,olympe.net.U.Ol,!1);F(a,olympe.net.U.Xp,20);Ma(a,olympe.net.R.Ea);E(a,olympe.net.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('net'));D(a,olympe.net.R.Ki,olympe.net.Li,olympe.net.R.Ca);D(a,olympe.net.R.bv,olympe.net.kv);E(a,olympe.net.R.Pl,[new olympe.W.ja(olympe.net.U.xi),new olympe.W.ja(olympe.net.U.Ol)],(b,c)=>new Map([['offlineEnabled',
396
- b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ta.node.host={};olympe.Ta.node.host.Id=function(a,b){this.H=b};olympe.Ta.node.host.Id.prototype.constructor=olympe.Ta.node.host.Id;olympe.Ta.node.host.Id.prototype.destroy=function(){};olympe.Ta.node.host.Id.prototype.destroy=olympe.Ta.node.host.Id.prototype.destroy;olympe.Ta.node.host.Id.prototype.gb=function(){return this.H};olympe.Ta.node.host.Id.ya=[olympe.host.Ce.Id];function zc(a){a.H.error('No history manager implemented in Node')}olympe.Ta.node.host.Qp=class{constructor(a){this.H=a}$i(){return!1}F(){zc(this);return null}C(){const a=this;return v(function*(){zc(a)})}};olympe.Ta.node.host.Qp.ya=[olympe.host.qt];olympe.Ta.node.host.ud=class{constructor(){this.C={};this.J={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.J[b]=setInterval(c,a)}F(a){clearInterval(this.J[a]);delete this.J[a]}};olympe.host.Pp.register(olympe.host.Ce.Op.gr,olympe.Ta.node.host.ud);olympe.Ta.node.host.ud.ya=[olympe.host.Ce.ud];olympe.Ta.node.host.ek=class{constructor(a){this.H=a}C(){return olympe.D.fa.F}F(){return!0}};olympe.Ta.node.host.ek.ya=[olympe.host.ek];function Ac(a){const b=olympe.net.Ba.$b.rh,c=olympe.net.Ba.$b.Bi;a.ea.J('healthcheck','/readiness',[olympe.net.Ba.Sd.GET],()=>{const d=Array.from(a.Z.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.ae('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.H.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.ae(g,
393
+ olympe.net.nf.C={Ms:'connect',Ru:'reconnect',qu:'message',Ls:'close',Rf:'end',zb:'error',de:'offline'};olympe.net.Li=class{constructor(a){this.H=a}start(){return Promise.reject('Try to start web server with the browser implementation.')}G(){return Promise.reject('Try to restart web server with the browser implementation.')}stop(){return Promise.reject('Try to stop web server with the browser implementation.')}K(){return Promise.reject('Try to open a route on a web server using the browser implementation.')}Z(){return Promise.reject('Try to close a route on a web server using the browser implementation.')}};
394
+ olympe.net.Li.C='*';olympe.net.lv=class{register(){return v(function*(){throw Error('Service Worker Manager must be overridden by a native layer: called "register"');})}};olympe.net.R={Ea:'net.Manager',Ca:'net.Logger',Ki:'net.WebServer',dv:'net.ServiceWorkerManager',Pl:'net.OfflineConfig'};olympe.net.U={ji:'net.httpPort',fp:'net.httpBodyLimit',gr:'net.http2',ep:'net.httpsCertificatesPath',Dj:'net.localNetworkSuffix',yi:'offline.enabled',Ol:'offline.autoBackOnline',Yp:'offline.downloadBatchSize'};
395
+ olympe.W.config(function(a){F(a,olympe.net.U.ji,3141);F(a,olympe.net.U.fp,100);F(a,olympe.net.U.gr,!1);F(a,olympe.net.U.ep,null);F(a,olympe.net.U.Dj,'frontend');F(a,olympe.net.U.yi,!1);F(a,olympe.net.U.Ol,!1);F(a,olympe.net.U.Yp,20);Ma(a,olympe.net.R.Ea);E(a,olympe.net.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('net'));D(a,olympe.net.R.Ki,olympe.net.Li,olympe.net.R.Ca);D(a,olympe.net.R.dv,olympe.net.lv);E(a,olympe.net.R.Pl,[new olympe.W.ja(olympe.net.U.yi),new olympe.W.ja(olympe.net.U.Ol)],(b,c)=>new Map([['offlineEnabled',
396
+ b],['offlineAutoBackOnline',!b||c]]))},'olympe.net');olympe.Ta.node.host={};olympe.Ta.node.host.Id=function(a,b){this.H=b};olympe.Ta.node.host.Id.prototype.constructor=olympe.Ta.node.host.Id;olympe.Ta.node.host.Id.prototype.destroy=function(){};olympe.Ta.node.host.Id.prototype.destroy=olympe.Ta.node.host.Id.prototype.destroy;olympe.Ta.node.host.Id.prototype.hb=function(){return this.H};olympe.Ta.node.host.Id.ya=[olympe.host.Ce.Id];function zc(a){a.H.error('No history manager implemented in Node')}olympe.Ta.node.host.Rp=class{constructor(a){this.H=a}$i(){return!1}F(){zc(this);return null}C(){const a=this;return v(function*(){zc(a)})}};olympe.Ta.node.host.Rp.ya=[olympe.host.rt];olympe.Ta.node.host.ud=class{constructor(){this.C={};this.K={}}destroy(){}O(a){clearTimeout(this.C[a]);delete this.C[a]}Z(a,b,c){this.C[b]=setTimeout(c,a)}G(a){clearTimeout(this.C[a]);delete this.C[a]}T(a,b,c){this.K[b]=setInterval(c,a)}F(a){clearInterval(this.K[a]);delete this.K[a]}};olympe.host.Qp.register(olympe.host.Ce.Pp.hr,olympe.Ta.node.host.ud);olympe.Ta.node.host.ud.ya=[olympe.host.Ce.ud];olympe.Ta.node.host.ek=class{constructor(a){this.H=a}C(){return olympe.D.fa.F}F(){return!0}};olympe.Ta.node.host.ek.ya=[olympe.host.ek];function Ac(a){const b=olympe.net.Ba.$b.rh,c=olympe.net.Ba.$b.Bi;a.ea.K('healthcheck','/readiness',[olympe.net.Ba.Sd.GET],()=>{const d=Array.from(a.Z.values()).map(e=>e.apply(a));return 0===d.length?Promise.resolve(new olympe.net.ae('No healthCheck is set',b,'Nothing to check')):Promise.allSettled(d).then(e=>{let f=!1,g='Health check result: ';for(const h of e)'rejected'===h.status?(f=!0,e=h.reason,g+=`\n${e}`,a.H.warn(`Health check detected a service which is DOWN: ${e}`)):g+=`\n${h.value}`;return new olympe.net.ae(g,
397
397
  f?c:b,f?'Some services are not working':'Everything is OK')})}).catch(d=>a.H.error(`Failed to add health check route ${d}`));a.F(()=>a.ea.stop())}function Bc(a,b){b=Array.from(b.entries()).map(([c,d])=>olympe.Y.Promise.qn(d(),a.ka,`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.H.warn(`Failed to close some resource: ${e.reason}`));return d})}
398
- function Cc(a){return v(function*(){try{const b=yield Bc(a,a.J),c=yield Bc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.J.clear(),a.T.clear()}})}
399
- olympe.Ta.node.host.Pj=class extends olympe.host.Pj{constructor(a,b,c,d=!0){super();this.H=a;this.ea=b;this.ka=c;this.Z=new Map;this.J=new Map;this.T=new Map;d&&Ac(this)}C(a,b=olympe.Y.zf()){this.Z.set(b,a);return b}G(a){this.Z.delete(a)}F(a,b=olympe.Y.zf()){this.J.set(b,a);return b}aa(a,b=olympe.Y.zf()){this.T.set(b,a);return b}O(a){this.J.has(a)?this.J.delete(a):this.T.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.iq,!0);F(a,olympe.host.U.Qq,1E4);Ka(a,olympe.host.R.tl,olympe.Ta.node.host.Qp,olympe.host.R.Ca);Ka(a,olympe.host.R.ak,olympe.Ta.node.host.ek,olympe.host.R.Ca);D(a,olympe.host.R.Qe,olympe.Ta.node.host.Pj,olympe.host.R.Ca,olympe.net.R.Ki,new olympe.W.ja(olympe.host.U.Qq),new olympe.W.ja(olympe.host.U.iq))},'olympe.native.node.host');olympe.W.run([olympe.host.R.Qe],a=>{olympe.Ta.node.host.vk=()=>a});olympe.net.qe={};olympe.net.qe.Al=class{constructor(a){this.H=a;this.C=new Map}G(){}F(){}};olympe.net.qe.WebSocket=class{constructor(a,b){this.H=b;this.id=a;this.C=null;this.buffer=[];this.O=this.G=this.J=this.T=null}V(){return this.id}open(a){const b=`#${this.id}`,c=this.ka(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.H.info('Websocket OPENED');this.T?(this.H.debug('Notifying upper layer for WebSocket',b),this.T()):this.H.warn('Nothing to notify for WebSocket',b);this.H.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
400
- this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):Ua(d.data);(this.H.J()||this.H.C()&&!d.startsWith('pong'))&&this.H.debug(b,'<',d);this.G&&this.G(d)});c.addEventListener('close',()=>{this.H.debug(`WebSocket ${b} CLOSED`);this.J&&this.J()});c.addEventListener('error',()=>{this.H.debug(`WebSocket ${b} ERROR`);this.O&&this.O()});this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:(this.H.J()||
398
+ function Cc(a){return v(function*(){try{const b=yield Bc(a,a.K),c=yield Bc(a,a.T);if(b||c)throw Error('Failed to gracefully close the backend');}finally{a.K.clear(),a.T.clear()}})}
399
+ olympe.Ta.node.host.Pj=class extends olympe.host.Pj{constructor(a,b,c,d=!0){super();this.H=a;this.ea=b;this.ka=c;this.Z=new Map;this.K=new Map;this.T=new Map;d&&Ac(this)}C(a,b=olympe.Y.Af()){this.Z.set(b,a);return b}G(a){this.Z.delete(a)}F(a,b=olympe.Y.Af()){this.K.set(b,a);return b}aa(a,b=olympe.Y.Af()){this.T.set(b,a);return b}O(a){this.K.has(a)?this.K.delete(a):this.T.delete(a)}};olympe.W.config(function(a){F(a,olympe.host.U.jq,!0);F(a,olympe.host.U.Rq,1E4);Ka(a,olympe.host.R.tl,olympe.Ta.node.host.Rp,olympe.host.R.Ca);Ka(a,olympe.host.R.ak,olympe.Ta.node.host.ek,olympe.host.R.Ca);D(a,olympe.host.R.Qe,olympe.Ta.node.host.Pj,olympe.host.R.Ca,olympe.net.R.Ki,new olympe.W.ja(olympe.host.U.Rq),new olympe.W.ja(olympe.host.U.jq))},'olympe.native.node.host');olympe.W.run([olympe.host.R.Qe],a=>{olympe.Ta.node.host.vk=()=>a});olympe.net.pe={};olympe.net.pe.Al=class{constructor(a){this.H=a;this.C=new Map}G(){}F(){}};olympe.net.pe.WebSocket=class{constructor(a,b){this.H=b;this.id=a;this.C=null;this.buffer=[];this.O=this.G=this.K=this.T=null}V(){return this.id}open(a){const b=`#${this.id}`,c=this.ka(a);c.binaryType='arraybuffer';c.addEventListener('open',()=>{this.H.info('Websocket OPENED');this.T?(this.H.debug('Notifying upper layer for WebSocket',b),this.T()):this.H.warn('Nothing to notify for WebSocket',b);this.H.debug(b,`Send all buffered messages (n=${this.buffer.length}).`);this.buffer.forEach(c.send.bind(c));
400
+ this.buffer.length=0});c.addEventListener('message',d=>{d='string'===typeof d.data?String(d.data):Ua(d.data);(this.H.K()||this.H.C()&&!d.startsWith('pong'))&&this.H.debug(b,'<',d);this.G&&this.G(d)});c.addEventListener('close',()=>{this.H.debug(`WebSocket ${b} CLOSED`);this.K&&this.K()});c.addEventListener('error',()=>{this.H.debug(`WebSocket ${b} ERROR`);this.O&&this.O()});this.C=c}send(a){const b=`#${this.id}`;if(null!==this.C){const c=this.C.constructor;switch(this.C.readyState){case c.OPEN:(this.H.K()||
401
401
  this.H.C()&&!a.startsWith('ping'))&&this.H.debug(b,'>',a);this.C.send(a);break;case c.CONNECTING:this.H.debug(b,'- Connecting: BUFFER','>',a);this.buffer.push(a);break;default:return this.H.debug(b,'- Closed','>',a),!1}}else this.H.debug(b,'- Not opened yet: BUFFER','>',a),this.buffer.push(a);return!0}close(){if(null!==this.C){const a=this.C.constructor,b=this.C.readyState;if(b===a.OPEN||b===a.CONNECTING){this.H.debug(`Force closing native websocket ${`#${this.id}`}`);this.C.close(1E3);return}}this.H.debug('Try to force close native websocket, but not open nor connecting')}ea(a){this.T=
402
- a||null}aa(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.J=a||null}ka(){}};olympe.net.qe.WebSocket.ya=[olympe.net.WebSocket];olympe.Ta.node.net={};olympe.Ta.node.net.vu=class extends olympe.net.Sa{constructor(a,b){super(a,b);this.Z=new olympe.Ta.node.net.Al(a)}T(){return'NodeJS'}cg(){return olympe.D.fa.F}G(a){var b=this.J++;a=a.C();this.H.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Ta.node.net.wu(b,this.H);b.open(a);return b}C(a,b){this.H.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.J++;b=qc(this,c,b);this.Z.G(c,{u:a.C(),s:nc(a),h:lc(a),p:a.port,z:mc(a),q:pc(a),m:a.method,v:a.Wi(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
402
+ a||null}aa(a){this.G=a||null}F(a){this.O=a||null}Z(a){this.K=a||null}ka(){}};olympe.net.pe.WebSocket.ya=[olympe.net.WebSocket];olympe.Ta.node.net={};olympe.Ta.node.net.wu=class extends olympe.net.Sa{constructor(a,b){super(a,b);this.Z=new olympe.Ta.node.net.Al(a)}T(){return'NodeJS'}cg(){return olympe.D.fa.F}G(a){var b=this.K++;a=a.C();this.H.debug('CREATE Websocket #'+b+' to '+a);b=new olympe.Ta.node.net.xu(b,this.H);b.open(a);return b}C(a,b){this.H.debug('SEND HTTP '+a.method+' to '+a.C());const c=this.K++;b=qc(this,c,b);this.Z.G(c,{u:a.C(),s:nc(a),h:lc(a),p:a.port,z:mc(a),q:pc(a),m:a.method,v:a.Wi(),k:a.key,c:a.cert,a:a.ca,j:a.rejectUnauthorized,
403
403
  b:a.body,r:a.F},b)}O(){this.H.warn('DOWNLOAD FILE not available with node native implementation. URL:')}F(){return this.Z}};const Dc=require('fs'),Ec=require('http'),Fc=require('https');
404
- olympe.Ta.node.net.Al=class extends olympe.net.qe.Al{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,x=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(y,z,A)=>new Promise((B,O)=>{Dc.readFile(y,(M,xa)=>{M?O(M):(A[z]=xa,B(A))})});p=y=>{const z=B=>{B.setEncoding(x===olympe.net.Ba.ResponseType.mm?'utf-8':'binary');let O='';B.on('data',M=>{O+=M});B.on('end',()=>{if(x!==olympe.net.Ba.ResponseType.mm){var M=
404
+ olympe.Ta.node.net.Al=class extends olympe.net.pe.Al{G(a,b,c){const d=b.s,e=b.b,f=b.m;var g=b.v;const h=b.k,k=b.c,l=b.a,n=b.j;var p=b.h;const q=b.p;let r=b.z;r.startsWith('/')||(r=`/${r}`);const t=b.q,u=b.u,x=b.r;b={host:p,port:q,path:t?r+'?'+t:r,method:f};g&&(b.headers=g);g=(y,z,A)=>new Promise((B,O)=>{Dc.readFile(y,(M,xa)=>{M?O(M):(A[z]=xa,B(A))})});p=y=>{const z=B=>{B.setEncoding(x===olympe.net.Ba.ResponseType.mm?'utf-8':'binary');let O='';B.on('data',M=>{O+=M});B.on('end',()=>{if(x!==olympe.net.Ba.ResponseType.mm){var M=
405
405
  new Uint8Array(Buffer.from(O,'binary'));M=x===olympe.net.Ba.ResponseType.Tk?new Blob(M):M}else M=O;c(this.F(B.statusCode,B.statusMessage,M,B.headers))})},A=d?new Fc.request(y,z):new Ec.request(y,z);this.C.set(a,()=>{A.destroy()});A.on('error',B=>{c(this.F(olympe.net.Ba.$b.Bi,'Connection refused','Error connecting to '+u+' with method '+f+', code = '+B.code+', message = '+B.message,''))});!e||'POST'!==f&&'PUT'!==f?A.end():(e instanceof Blob?e.arrayBuffer():Promise.resolve(e)).then(B=>{A.write(B instanceof
406
- ArrayBuffer?Buffer.from(B):B);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(y=>{this.H.log('Error loading self signed files:',y)})):this.H.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.H.debug('Received HTTP response',a,c);return new olympe.net.ae(c,a,b,d)}};olympe.Ta.node.net.wu=class extends olympe.net.qe.WebSocket{ka(a){return new (require('ws'))(a)}};olympe.Ta.node.net.U={CC:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.xi)&&Na(a,olympe.net.U.xi,!1);Ka(a,olympe.net.R.Ea,olympe.Ta.node.net.vu,olympe.net.R.Ca,olympe.host.R.Ea)},'olympe.native.node.net');olympe.Ta.node.net.http={};const Gc=require('fastify'),{Readable:Hc}=require('stream'),Ic={$j:0,Zj:1,gm:2},Jc=olympe.net.Ba.Sd.Yp,Kc=olympe.net.Ba.Headers.ws,Lc=olympe.net.Ba.Headers.us,Mc=olympe.net.Ba.Headers.vs,Nc=olympe.net.Ba.$b.rh;
407
- function Oc(a,b){const c=b.methods,d=b.Bx,e=b.headers,f=b.origin;a.F.route({bodyLimit:a.aa<<20,url:b.path,method:[...c,Jc],handler:(g,h)=>{var k=g.method;const l={[Kc]:f,[Mc]:c,[Lc]:e};if(k===Jc)return a.H.debug('< HTTP: OPTIONS'),h.code(Nc).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=new olympe.net.ki(q,parseInt(r,10),g.url,'https'===g.protocol,k,p);for(const [t,
408
- u]of Object.entries(g.headers))k.headers[t]=u;a.H.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 Hc)&&h.type(olympe.net.Ba.fl.Wf);if(u>=olympe.net.Ba.$b.Bi)throw Error(x);u>=olympe.net.Ba.$b.Rk?a.H.warn('> HTTP: client bad request: reply with error:',x):a.H.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,
409
- t.Wi())).send(x)}).catch(t=>{a.H.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.Ba.$b.Bi).headers(Object.assign(l,{[olympe.net.Ba.Headers.bi]:'text/plain'})).send('Internal server error')})}})}
410
- olympe.Ta.node.net.http.Li=class extends olympe.net.Li{constructor(a,b,c,d,e){super(a);this.aa=c;this.port=b;this.ea=d;this.T=e;this.F=this.createServer();this.O=new Map;this.C=Ic.$j;this.Bd=new Set;this.timer=null}J(a,b,c,d){this.O.set(a,{path:b,methods:c,Bx:d,headers:'*',origin:'*'});return this.G()}Z(a){const b=this;return v(function*(){b.O.delete(a);return 0<b.O.size?b.G():b.stop()})}start(){if(this.C===Ic.$j)return this.G();if(this.C===Ic.Zj){for(const a of this.O.values())Oc(this,a);return this.F.listen({port:this.port,
406
+ ArrayBuffer?Buffer.from(B):B);A.end()})};d&&(h||k||l)?h&&k&&l?(b.rejectUnauthorized=n,g(h,'key',b).then(g.bind(null,k,'cert')).then(g.bind(null,l,'ca')).then(p).catch(y=>{this.H.log('Error loading self signed files:',y)})):this.H.warn('All three self signed files must be specified!'):p(b)}F(a,b,c,d){this.H.debug('Received HTTP response',a,c);return new olympe.net.ae(c,a,b,d)}};olympe.Ta.node.net.xu=class extends olympe.net.pe.WebSocket{ka(a){return new (require('ws'))(a)}};olympe.Ta.node.net.U={DC:'native.html.net.useWorkers'};olympe.W.config(function(a){a.getParameter(olympe.net.U.yi)&&Na(a,olympe.net.U.yi,!1);Ka(a,olympe.net.R.Ea,olympe.Ta.node.net.wu,olympe.net.R.Ca,olympe.host.R.Ea)},'olympe.native.node.net');olympe.Ta.node.net.http={};const Gc=require('fastify'),{Readable:Hc}=require('stream'),Ic={$j:0,Zj:1,gm:2},Jc=olympe.net.Ba.Sd.Zp,Kc=olympe.net.Ba.Headers.xs,Lc=olympe.net.Ba.Headers.vs,Mc=olympe.net.Ba.Headers.ws,Nc=olympe.net.Ba.$b.rh;
407
+ function Oc(a,b){const c=b.methods,d=b.Cx,e=b.headers,f=b.origin;a.F.route({bodyLimit:a.aa<<20,url:b.path,method:[...c,Jc],handler:(g,h)=>{a.H.debug('Incoming request:','hostname:',g.hostname,'headers:',JSON.stringify(g.headers));var k=g.method;const l={[Kc]:f,[Mc]:c,[Lc]:e};if(k===Jc)return a.H.debug('< HTTP: OPTIONS'),h.code(Nc).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(':');
408
+ k=new olympe.net.li(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.H.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 Hc)&&h.type(olympe.net.Ba.fl.Wf);if(u>=olympe.net.Ba.$b.Bi)throw Error(x);u>=olympe.net.Ba.$b.Rk?a.H.warn('> HTTP: client bad request: reply with error:',
409
+ x):a.H.debug('> HTTP: reply with body:',Buffer.isBuffer(x)?'binary':x);return h.code(u).headers(Object.assign(l,t.Wi())).send(x)}).catch(t=>{a.H.error('> HTTP: reply with internal server error:',t);return h.code(olympe.net.Ba.$b.Bi).headers(Object.assign(l,{[olympe.net.Ba.Headers.ci]:'text/plain'})).send('Internal server error')})}})}
410
+ olympe.Ta.node.net.http.Li=class extends olympe.net.Li{constructor(a,b,c,d,e){super(a);this.aa=c;this.port=b;this.ea=d;this.T=e;this.F=this.createServer();this.O=new Map;this.C=Ic.$j;this.Bd=new Set;this.timer=null}K(a,b,c,d){this.O.set(a,{path:b,methods:c,Cx:d,headers:'*',origin:'*'});return this.G()}Z(a){const b=this;return v(function*(){b.O.delete(a);return 0<b.O.size?b.G():b.stop()})}start(){if(this.C===Ic.$j)return this.G();if(this.C===Ic.Zj){for(const a of this.O.values())Oc(this,a);return this.F.listen({port:this.port,
411
411
  host:'0.0.0.0'}).then(a=>{this.C=Ic.gm;this.H.debug('Web server listening on '+a);this.Bd.forEach(b=>b(null))}).catch(a=>{this.stop().then();this.Bd.forEach(b=>b(a))}).finally(()=>this.Bd.clear())}return Promise.reject('Try to start a webservice already started')}G(){return this.C===Ic.Zj?(new Promise((a,b)=>{this.Bd.add(c=>c?b(c):a())})).then(()=>this.G()):new Promise((a,b)=>{this.Bd.add(c=>c?b(c):a());this.nk(()=>{const c=this;return v(function*(){c.C=Ic.Zj;yield c.F.close();c.F=c.createServer();
412
- yield c.start()})})})}stop(){return this.C===Ic.gm?this.F.close().then(()=>{this.C=Ic.$j}):Promise.resolve()}createServer(){var a={logger:{level:'warn'},http2:this.ea};if('string'===typeof this.T){const b=require('fs'),c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.T,'key.pem')),cert:b.readFileSync(c.join(this.T,'cert.pem'))}})}a=Gc(a);a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}nk(a,b=1E3){this.timer&&clearTimeout(this.timer);
413
- this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.R.Ki,olympe.Ta.node.net.http.Li,olympe.net.R.Ca,new olympe.W.ja(olympe.net.U.ii),new olympe.W.ja(olympe.net.U.fp),new olympe.W.ja(olympe.net.U.fr),new olympe.W.ja(olympe.net.U.ep))},'olympe.native.node.net.http');olympe.Ta.node.Y={};const Pc=require('stream').Readable,Qc=require('buffer');
414
- olympe.Ta.node.Y.Wk=class extends olympe.Y.Wk{F(a){return new Uint8Array(Buffer.from(a,'base64'))}C(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 v(function*(){if(a instanceof Pc){const d=[];for(const e=ha(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}G(a){return Promise.resolve().then(()=>Qc.resolveObjectURL(a)).catch(b=>
415
- {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Ka(a,olympe.Y.R.jg,olympe.Ta.node.Y.Wk)},'olympe.native.node.utils');olympe.async={};function Rc(a,b){a.J||a.Z.push(a.G.G(b))}
416
- olympe.async.Ho=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Zb('Async executor context');this.ka=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.J=this.O=!1;this.H=null;this.timer=this.timeout=0;this.aa=olympe.Y.Mc()}qn(a){0<=a&&(this.timeout=a);return this}gb(){return this.H}add(a){this.J||this.F.push(this.G.G(a));return this}start(){this.O||(this.H&&this.H.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
417
- this.aa),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.ka&&this.G.destroy()}complete(a){this.G.Hf(this.aa);if(!this.J){this.J=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.H&&this.H.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
418
- function Sc(a){if(0<a.F.length){const b=a.F.shift();a.H&&a.H.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{Sc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Uq=class extends olympe.async.Ho{static create(){return new olympe.async.Uq(new olympe.D.Zb('SequencedExecutor'),!0)}start(){this.O||(super.start(),Sc(this))}};
419
- olympe.async.Oj=class extends olympe.async.Ho{constructor(a,b){super(a,b);this.T=0;this.ea=!0}static create(){return new olympe.async.Oj(new olympe.D.Zb('ParallelExecutor'),!0)}run(a){this.H&&this.H.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ea=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.O&&!this.J&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ea)}start(){if(!this.O)if(super.start(),
420
- 0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.cu=class{F(){return v(function*(){})}Z(){}O(){}G(){}T(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}aa(){}clear(){}J(){}};olympe.Db.du=class{F(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.mu=class{get(){return null}set(){return this}delete(){}};olympe.Db.R={Cj:'localStorage.KeyValueDatabaseManager',Ci:'localStorage.Storage',oz:'localStorage.DatacloudStorage',Il:'localStorage.LocalStorage',Ca:'localStorage.Logger',Fg:'localStorage.prefix'};olympe.W.config(function(a){Ma(a,olympe.Db.R.Cj);E(a,olympe.Db.R.Fg,[],()=>'olympe');E(a,olympe.Db.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('localstorage'));D(a,olympe.Db.R.Il,olympe.Db.mu)},'olympe.localstorage');olympe.N={};olympe.N.errors={};olympe.N.errors.zo=class extends Error{};olympe.N.errors.bq=class extends Error{};olympe.N.errors.Up=class extends Error{};olympe.N.errors.fk=class extends Error{};olympe.N.errors.eo=class extends Error{};olympe.N.errors.Gq=class extends Error{};olympe.N.errors.gq=class extends Error{};olympe.N.errors.Fv=class extends Error{};olympe.N.errors.jm=class extends Error{constructor(a,b){super(a);this.id=b}V(){return this.id}};olympe.N.errors.Hj=class extends olympe.N.errors.jm{};
421
- olympe.N.errors.Rn=class extends olympe.N.errors.jm{};olympe.N.errors.bp=class extends olympe.N.errors.jm{};olympe.N.ac={xj:'urls.FileSvc',En:'urls.BackupSvc',zq:'urls.RestoreBackupSvc',qg:'urls.GetContext',Yo:'urls.GraphDef',Tn:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',er:'urls.UserTagFromToken',Ev:'urls.UserNameFromTag',Dv:'urls.UserRoles',Uu:'urls.RoleMembers',Jj:'urls.OpenIDSvc'};
422
- olympe.W.config(a=>{F(a,olympe.N.ac.xj,'rest/filesvc');F(a,olympe.N.ac.En,'rest/backupsvc');F(a,olympe.N.ac.zq,'rest/backupsvc/restore');F(a,olympe.N.ac.Jj,'rest/openid');F(a,olympe.N.ac.qg,'rest/initialData');F(a,olympe.N.ac.Yo,'rest/querysvc/graphDef');F(a,olympe.N.ac.Tn,'rest/querysvc/graphDef/static');F(a,olympe.N.ac.TRANSACTION,'rest/transaction');F(a,olympe.N.ac.er,'rest/token');F(a,olympe.N.ac.Ev,'rest/authorization/getUserTag');F(a,olympe.N.ac.Dv,'rest/authorization/getUserRoles');F(a,olympe.N.ac.Uu,
412
+ yield c.start()})})})}stop(){return this.C===Ic.gm?this.F.close().then(()=>{this.C=Ic.$j}):Promise.resolve()}createServer(){var a={logger:{level:olympe.ma.Fb.F[this.H.O()].toLowerCase()},http2:this.ea};if('string'===typeof this.T){const b=require('fs'),c=require('path');Object.assign(a,{https:{allowHTTP1:!0,key:b.readFileSync(c.join(this.T,'key.pem')),cert:b.readFileSync(c.join(this.T,'cert.pem'))}})}a=Gc(a);a.addContentTypeParser('*',{parseAs:'buffer'},(b,c,d)=>{d(null,c)});return a}nk(a,b=1E3){this.timer&&
413
+ clearTimeout(this.timer);this.timer=setTimeout(a,b)}};olympe.W.config(function(a){D(a,olympe.net.R.Ki,olympe.Ta.node.net.http.Li,olympe.net.R.Ca,new olympe.W.ja(olympe.net.U.ji),new olympe.W.ja(olympe.net.U.fp),new olympe.W.ja(olympe.net.U.gr),new olympe.W.ja(olympe.net.U.ep))},'olympe.native.node.net.http');olympe.Ta.node.Y={};const Pc=require('stream').Readable,Qc=require('buffer');
414
+ olympe.Ta.node.Y.Wk=class extends olympe.Y.Wk{F(a){return new Uint8Array(Buffer.from(a,'base64'))}C(a){return a instanceof Uint8Array?Buffer.from(a,a.byteOffset,a.byteLength).toString('base64'):Buffer.from(a).toString('base64')}K(a){const b=this,c=()=>super.K;return v(function*(){if(a instanceof Pc){const d=[];for(const e=ha(a);;){const f=yield e.next();if(f.done)break;d.push(f.value)}return Buffer.concat(d)}return c().call(b,a)})}G(a){return Promise.resolve().then(()=>Qc.resolveObjectURL(a)).catch(b=>
415
+ {throw Error(`Error while trying to fetch buffer from ObjectURL: ${b}`);})}};olympe.W.config(function(a){Ka(a,olympe.Y.R.jg,olympe.Ta.node.Y.Wk)},'olympe.native.node.utils');olympe.async={};function Rc(a,b){a.K||a.Z.push(a.G.G(b))}
416
+ olympe.async.Ho=class{constructor(a,b=void 0===a){this.F=[];this.Z=[];this.G=a||new olympe.D.Zb('Async executor context');this.ka=b;this.C=null;this.env=new Map;this.env.set('Executor',this);this.K=this.O=!1;this.H=null;this.timer=this.timeout=0;this.aa=olympe.Y.Nc()}qn(a){0<=a&&(this.timeout=a);return this}hb(){return this.H}add(a){this.K||this.F.push(this.G.G(a));return this}start(){this.O||(this.H&&this.H.log('Executor started.'),this.O=!0,this.G.onDestroy(()=>{this.C='Context destroyed.';this.complete(!1)},
417
+ this.aa),0<this.timeout&&(this.timer=setTimeout(()=>{this.C='Timeout expired.';this.timer=0;this.complete(!1)},this.timeout)))}clear(){this.F=[];this.Z=[];this.env.clear();this.ka&&this.G.destroy()}complete(a){this.G.If(this.aa);if(!this.K){this.K=!0;this.timer&&(clearTimeout(this.timer),this.timer=0);this.H&&this.H.log(a?'Executor completed successfully':`Executor completed with error: ${this.C}`);for(const b of this.Z)b(a,a?null:this.C,this.env);this.clear()}}getContext(){return this.G}};
418
+ function Sc(a){if(0<a.F.length){const b=a.F.shift();a.H&&a.H.log(`Executing next task. ${a.F.length} tasks left in the pipeline.`);a.getContext().run(()=>{b(()=>{Promise.resolve().then(()=>{Sc(a)})},c=>{c&&(a.C=c);a.complete(!1)},a.env)})}else a.complete(!0)}olympe.async.Vq=class extends olympe.async.Ho{static create(){return new olympe.async.Vq(new olympe.D.Zb('SequencedExecutor'),!0)}start(){this.O||(super.start(),Sc(this))}};
419
+ olympe.async.Oj=class extends olympe.async.Ho{constructor(a,b){super(a,b);this.T=0;this.ea=!0}static create(){return new olympe.async.Oj(new olympe.D.Zb('ParallelExecutor'),!0)}run(a){this.H&&this.H.log('Starting a task');this.getContext().run(()=>{a(()=>{this.done()},b=>{this.ea=!1;b&&(this.C=this.C?`${this.C}. ${b}`:b);this.done()},this.env)})}add(a){super.add(a);this.O&&!this.K&&(this.T++,this.run(a));return this}done(){this.T--;0>=this.T&&this.complete(this.ea)}start(){if(!this.O)if(super.start(),
420
+ 0<this.F.length){this.T=this.F.length;for(const a of this.F)this.run(a)}else this.complete(!0)}};olympe.Db={};olympe.Db.du=class{F(){return v(function*(){})}Z(){}O(){}G(){}T(){}forEach(){}has(){}get(){}set(){}remove(){}ea(){}aa(){}clear(){}K(){}};olympe.Db.eu=class{F(){}};olympe.Db.Storage=class{open(){}write(){}close(){}};olympe.Db.nu=class{get(){return null}set(){return this}delete(){}};olympe.Db.R={Cj:'localStorage.KeyValueDatabaseManager',Ci:'localStorage.Storage',pz:'localStorage.DatacloudStorage',Il:'localStorage.LocalStorage',Ca:'localStorage.Logger',Fg:'localStorage.prefix'};olympe.W.config(function(a){Ma(a,olympe.Db.R.Cj);E(a,olympe.Db.R.Fg,[],()=>'olympe');E(a,olympe.Db.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('localstorage'));D(a,olympe.Db.R.Il,olympe.Db.nu)},'olympe.localstorage');olympe.N={};olympe.N.errors={};olympe.N.errors.zo=class extends Error{};olympe.N.errors.cq=class extends Error{};olympe.N.errors.Vp=class extends Error{};olympe.N.errors.fk=class extends Error{};olympe.N.errors.eo=class extends Error{};olympe.N.errors.Hq=class extends Error{};olympe.N.errors.hq=class extends Error{};olympe.N.errors.Gv=class extends Error{};olympe.N.errors.jm=class extends Error{constructor(a,b){super(a);this.id=b}V(){return this.id}};olympe.N.errors.Hj=class extends olympe.N.errors.jm{};
421
+ olympe.N.errors.Rn=class extends olympe.N.errors.jm{};olympe.N.errors.bp=class extends olympe.N.errors.jm{};olympe.N.ac={xj:'urls.FileSvc',En:'urls.BackupSvc',Aq:'urls.RestoreBackupSvc',qg:'urls.GetContext',Yo:'urls.GraphDef',Tn:'urls.StaticGraphDef',TRANSACTION:'urls.Transaction',fr:'urls.UserTagFromToken',Fv:'urls.UserNameFromTag',Ev:'urls.UserRoles',Vu:'urls.RoleMembers',Jj:'urls.OpenIDSvc'};
422
+ olympe.W.config(a=>{F(a,olympe.N.ac.xj,'rest/filesvc');F(a,olympe.N.ac.En,'rest/backupsvc');F(a,olympe.N.ac.Aq,'rest/backupsvc/restore');F(a,olympe.N.ac.Jj,'rest/openid');F(a,olympe.N.ac.qg,'rest/initialData');F(a,olympe.N.ac.Yo,'rest/querysvc/graphDef');F(a,olympe.N.ac.Tn,'rest/querysvc/graphDef/static');F(a,olympe.N.ac.TRANSACTION,'rest/transaction');F(a,olympe.N.ac.fr,'rest/token');F(a,olympe.N.ac.Fv,'rest/authorization/getUserTag');F(a,olympe.N.ac.Ev,'rest/authorization/getUserRoles');F(a,olympe.N.ac.Vu,
423
423
  'rest/authorization/roleMembers')});function Tc(a){a.H.info('Disconnected from bus');let b;null==(b=a.C)||b.forEach((c,d)=>{null!==c.F&&(a.H.info(`Disconnected from bus: pause keep alive of ${c.C.size} subscriptions for ${d} service.`),Vc(c))})}
424
- function Wc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.J);return uc(a.F,a.J,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));Xc(a,b.seq,'consumed');const c=olympe.N.cb.F(b,a.Fa,d=>Yc(a,b.src,d).stream);Xc(a,c.be.toString(),'deserialized',(new Map).set('source',c.sb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.N.cb.C.Wf)Zc(a,c);else{let d;null==(d=a.G.get(c.be))||d(c)}})}
424
+ function Wc(a){a.H.debug('Connection to bus established. Listening to responses on topic',a.K);return uc(a.F,a.K,b=>{a.H.C()&&a.H.debug('BUS <',JSON.stringify(b));Xc(a,b.seq,'consumed');const c=olympe.N.cb.F(b,a.Fa,d=>Yc(a,b.src,d).stream);Xc(a,c.be.toString(),'deserialized',(new Map).set('source',c.sb()).set('messageType',c.getType().toString()));if(c.getType()===olympe.N.cb.C.Wf)Zc(a,c);else{let d;null==(d=a.G.get(c.be))||d(c)}})}
425
425
  function $c(a){a.aa.forEach(c=>c(null));a.aa=[];a.H.debug(`Reconnected to bus: resubscribe to ${a.ua.size} active topics.`);a.ua.forEach((c,d)=>{ad(a,d,c).then(()=>{})});let b;null==(b=a.C)||b.forEach((c,d)=>{null===c.F&&(a.H.debug(`Reconnected to bus: restart keep alive of ${c.C.size} subscriptions for ${d} service.`),bd(c,!0))})}function cd(a){return dd(a.vb)&&sc(a.F)}function ed(a){a.Ib=a.ka.C(()=>cd(a)?Promise.resolve('Bus connection OK'):Promise.reject('Bus is disconnected'))}
426
- function Xc(a,b,c,d=new Map){a.bc.C&&cb(a.bc,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function Yc(a,b,c){const d=`${b}:${c}`;b=a.ea.get(d);b||(b=new olympe.N.fq(()=>a.ea.delete(d)),a.ea.set(d,b));return b}
427
- function Zc(a,b){const c=olympe.N.Ae.ng,d=olympe.N.Ae.Qf,e=olympe.N.Ae.zb,f=b.C,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=Yc(a,b.sb(),g);if(h===c){Wa(a.ea.C,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}`))}
426
+ function Xc(a,b,c,d=new Map){a.bc.C&&cb(a.bc,'com',d.set('id',`${b}`).set('channel','bus').set('eventType',c))}function Yc(a,b,c){const d=`${b}:${c}`;b=a.ea.get(d);b||(b=new olympe.N.gq(()=>a.ea.delete(d)),a.ea.set(d,b));return b}
427
+ function Zc(a,b){const c=olympe.N.Ae.ng,d=olympe.N.Ae.Rf,e=olympe.N.Ae.zb,f=b.C,{id:g,e:h}=f,k=`${b.sb()}:${g}`,l=Yc(a,b.sb(),g);if(h===c){Wa(a.ea.C,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}`))}
428
428
  function ad(a,b,c){return v(function*(){cd(a)||(yield a.connect());a.H.debug(`Bus: Subscribe to ${b}`);a.ua.set(b,c);yield uc(a.F,b,d=>{a.H.C()&&a.H.debug(`BUS < #${b}: ${JSON.stringify(d)}`);let e=null;try{if(Xc(a,d.seq,'consumed'),e=olympe.N.bk.F(d,a.Fa,f=>Yc(a,d.src,f).stream),Xc(a,e.be.toString(),'deserialized',(new Map).set('source',e.sb()).set('messageType',e.getType().toString())),e.getType()===olympe.N.cb.C.Wf){Zc(a,e);return}}catch(f){a.H.error(`An error occurred while trying to deserialize the request: ${JSON.stringify(d)} with error ${f}`)}null!==
429
- e&&c(e)})})}function fd(a,b,c,d){const e=gd(a.O).wd();a.Z++;return new olympe.N.bk(b,a.J,e,a.Z,c,d)}function hd(a,b,c,d){const e=b.be;let f=null;f=setTimeout(()=>id(a,e),a.Bc);a.G.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.N.cb.C.Lk?f=setTimeout(()=>id(a,e),d):(a.G.delete(e),c(g))})}function id(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.cb(a.J,a.J,b,olympe.N.cb.C.zb,{reason:'Timeout'}))}
430
- function jd(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>id(a,c),a.Bc);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}function kd(a,b){return v(function*(){let c;const d=null==(c=a.C)?void 0:c.get(b);d&&(Vc(d),a.C.delete(b));a.ua.delete(b);a.H.debug(`Bus: Unsubscribe to ${b}`);if(cd(a))return vc(a.F,b)})}
431
- function ld(a,b,c,d,e){null===a.C&&(a.C=new Map);let f=a.C.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(Vc(a),bd(a,!1)))):(f=new olympe.N.pv(a.H,a,b,d),a.C.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&bd(d,!1)}function md(a,b,c){var d;const e=null==(d=a.C)?void 0:d.get(b);if(null==e?0:nd(e,c))d=olympe.N.cb.C.sm,cd(a)&&a.publish(fd(a,b,d,c)).catch(f=>a.H.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.C.delete(b),0===a.C.size&&(a.C=null))}
432
- function od(a,b){return new Promise((c,d)=>{a.O.Ug(b.ne(),(e,f)=>{e?d(e):c(f)})})}
433
- olympe.N.Sn=class{constructor(a,b,c,d,e,f,g,h){b=h.get('connectionOptions');this.H=a;this.vb=c;this.O=d;this.ka=e;this.Fa=f;this.bc=g;this.Bc=h.get('shortTimeout');this.hc=h.get('requestTimeout');this.Tc=h.get('subscriptionsRefreshRate');this.G=new Map;this.F=rc(h.get('url'),b);this.kb=h.get('allowGuest');this.Td=this.Z=0;this.J=olympe.Y.Mc();this.C=null;this.T=!1;this.aa=[];this.ua=new Map;this.ea=new olympe.Y.Ah(this.hc);this.Ub=this.Ib='';this.ab=!1;wc(this.F,()=>{Tc(this)});yc(this.F,()=>{this.T=
434
- !0});xc(this.F,()=>{this.T&&Wc(this).then(()=>{this.T=!1;$c(this)}).catch(k=>{this.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${k}`);this.F.end()})})}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.aa.forEach(e=>e(d));this.aa=[]};cd(this)?a():this.T||this.ab?this.aa.push(d=>d?b(d):a()):dd(this.vb)?(this.ab=!0,olympe.D.cs([this.O.Ck()],d=>{ed(this);this.ab=!1;d.valueOf()||this.kb?(this.kb||pd(this.O,()=>this.disconnect().then()),
435
- this.T=!0,this.F.connect(()=>gd(this.O),()=>a()),this.Ub=this.ka.aa(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.ka.delete('busLogoutCallback');this.F.end(!1,()=>a());this.ka.G(this.Ib);this.ka.O(this.Ub)})}publish(a){const b=this;return v(function*(){if(!b.T||
436
- a.getType()!==olympe.N.cb.C.we){cd(b)||(yield b.connect());var c=a.pc();try{Xc(b,a.be.toString(),'serialize');var d=a.ha(b.Fa,b.ad.bind(b,a));b.H.C()&&b.H.debug(`BUS > #${c}: ${JSON.stringify(d)}`)}catch(e){throw Error(`An error occurred while serializing the message (seqId=${a.be}): ${e}`);}yield b.F.publish(c,d);Xc(b,a.be.toString(),'publish',(new Map).set('destination',a.pc()).set('messageType',a.getType().toString()))}})}ad(a,b){const c=this.Td++;(()=>{const d=this;return v(function*(){const e=
437
- l=>d.publish(new olympe.N.cb(a.pc(),a.sb(),a.be,olympe.N.cb.C.Wf,l)),f=olympe.N.Ae.ng,g=olympe.N.Ae.Qf,h=olympe.N.Ae.zb;let k=0;try{for(const l=ha(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}qd(a,b,c){return this.send(a.be,a.sb(),b,c)}send(a,b,c,d){return this.publish(new olympe.N.cb(b,this.J,a,c,d))}request(a,b,c,d){const e=fd(this,a,b,c);
438
- c=olympe.N.cb.C.Lk;if(b===olympe.N.cb.C.PUBLISH){const f=new olympe.N.cb(a,this.J,e.be,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{hd(this,e,f,null!=d?d:this.hc);this.publish(e).catch(g)})}};olympe.N.Sn.C='Timeout';const qd=olympe.net.Ba.Headers.Dn,rd=olympe.net.Ba.$b.rh,sd=olympe.net.Ba.$b.Yn,td=olympe.net.Ba.$b.ij,ud=olympe.net.Ba.$b.$u,vd=olympe.net.Ba.$b.Fs,wd=olympe.net.Ba.$b.Mo,xd=olympe.net.Ba.$b.zv,yd=olympe.net.Ba.$b.Ml;function zd(a,b){let c;return null!=(c=a.O.get(b))?c:''}function Ad(a,b,c,d=new Map){a.C.C&&cb(a.C,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
429
+ e&&c(e)})})}function fd(a,b,c,d){const e=gd(a.O).wd();a.Z++;return new olympe.N.bk(b,a.K,e,a.Z,c,d)}function hd(a,b,c,d){const e=b.be;let f=null;f=setTimeout(()=>id(a,e),a.Cc);a.G.set(e,g=>{f&&clearTimeout(f);g.getType()===olympe.N.cb.C.Lk?f=setTimeout(()=>id(a,e),d):(a.G.delete(e),c(g))})}function id(a,b){const c=a.G.get(b);a.G.delete(b);null==c||c(new olympe.N.cb(a.K,a.K,b,olympe.N.cb.C.zb,{reason:'Timeout'}))}
430
+ function jd(a,b){a.Z++;const c=a.Z,d=setTimeout(()=>id(a,c),a.Cc);a.G.set(c,e=>{a.G.delete(c);clearTimeout(d);b(e)});return a.Z}function kd(a,b){return v(function*(){let c;const d=null==(c=a.C)?void 0:c.get(b);d&&(Vc(d),a.C.delete(b));a.ua.delete(b);a.H.debug(`Bus: Unsubscribe to ${b}`);if(cd(a))return vc(a.F,b)})}
431
+ function ld(a,b,c,d,e){null===a.C&&(a.C=new Map);let f=a.C.get(b);f?(a=f,a.G!==d&&(a.G=d,null!==a.F&&(Vc(a),bd(a,!1)))):(f=new olympe.N.qv(a.H,a,b,d),a.C.set(b,f));d=f;d.C.set(c,e);1===d.C.size&&bd(d,!1)}function md(a,b,c){var d;const e=null==(d=a.C)?void 0:d.get(b);if(null==e?0:nd(e,c))d=olympe.N.cb.C.sm,cd(a)&&a.publish(fd(a,b,d,c)).catch(f=>a.H.error(`Impossible to keep alive subscriptions: ${f}`)),0===e.C.size&&(a.C.delete(b),0===a.C.size&&(a.C=null))}
432
+ function od(a,b){return new Promise((c,d)=>{a.O.Ug(b.me(),(e,f)=>{e?d(e):c(f)})})}
433
+ olympe.N.Sn=class{constructor(a,b,c,d,e,f,g,h){b=h.get('connectionOptions');this.H=a;this.vb=c;this.O=d;this.ka=e;this.Fa=f;this.bc=g;this.Cc=h.get('shortTimeout');this.hc=h.get('requestTimeout');this.Uc=h.get('subscriptionsRefreshRate');this.G=new Map;this.F=rc(h.get('url'),b);this.kb=h.get('allowGuest');this.Td=this.Z=0;this.K=olympe.Y.Nc();this.C=null;this.T=!1;this.aa=[];this.ua=new Map;this.ea=new olympe.Y.Bh(this.hc);this.Vb=this.Ib='';this.ab=!1;wc(this.F,()=>{Tc(this)});yc(this.F,()=>{this.T=
434
+ !0});xc(this.F,()=>{this.T&&Wc(this).then(()=>{this.T=!1;$c(this)}).catch(k=>{this.H.error(`An error occurred while trying to subscribe to "response topic" on the bus. Close connection: ${k}`);this.F.end()})})}connect(){return new Promise((a,b)=>{const c=d=>{b(d);this.aa.forEach(e=>e(d));this.aa=[]};cd(this)?a():this.T||this.ab?this.aa.push(d=>d?b(d):a()):dd(this.vb)?(this.ab=!0,olympe.D.ds([this.O.Ck()],d=>{ed(this);this.ab=!1;d.valueOf()||this.kb?(this.kb||pd(this.O,()=>this.disconnect().then()),
435
+ this.T=!0,this.F.connect(()=>gd(this.O),()=>a()),this.Vb=this.ka.aa(()=>this.disconnect(),'Bus websocket')):c(Error('Guest user is not allowed to connect to RabbitMQ, you can allow guest with the bus.allowGuest oConfig parameter!'))})):c(Error('Cannot connect to the bus if working offline'))})}disconnect(){return new Promise(a=>{this.H.debug('Disconnecting from bus');this.O.ka.delete('busLogoutCallback');this.F.end(!1,()=>a());this.ka.G(this.Ib);this.ka.O(this.Vb)})}publish(a){const b=this;return v(function*(){if(!b.T||
436
+ a.getType()!==olympe.N.cb.C.ve){cd(b)||(yield b.connect());var c=a.pc();try{Xc(b,a.be.toString(),'serialize');var d=a.ha(b.Fa,b.ad.bind(b,a));b.H.C()&&b.H.debug(`BUS > #${c}: ${JSON.stringify(d)}`)}catch(e){throw Error(`An error occurred while serializing the message (seqId=${a.be}): ${e}`);}yield b.F.publish(c,d);Xc(b,a.be.toString(),'publish',(new Map).set('destination',a.pc()).set('messageType',a.getType().toString()))}})}ad(a,b){const c=this.Td++;(()=>{const d=this;return v(function*(){const e=
437
+ l=>d.publish(new olympe.N.cb(a.pc(),a.sb(),a.be,olympe.N.cb.C.Wf,l)),f=olympe.N.Ae.ng,g=olympe.N.Ae.Rf,h=olympe.N.Ae.zb;let k=0;try{for(const l=ha(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}qd(a,b,c){return this.send(a.be,a.sb(),b,c)}send(a,b,c,d){return this.publish(new olympe.N.cb(b,this.K,a,c,d))}request(a,b,c,d){const e=fd(this,a,b,c);
438
+ c=olympe.N.cb.C.Lk;if(b===olympe.N.cb.C.PUBLISH){const f=new olympe.N.cb(a,this.K,e.be,c);return this.publish(e).then(()=>f)}return new Promise((f,g)=>{hd(this,e,f,null!=d?d:this.hc);this.publish(e).catch(g)})}};olympe.N.Sn.C='Timeout';const qd=olympe.net.Ba.Headers.Dn,rd=olympe.net.Ba.$b.rh,sd=olympe.net.Ba.$b.Yn,td=olympe.net.Ba.$b.ij,ud=olympe.net.Ba.$b.av,vd=olympe.net.Ba.$b.Gs,wd=olympe.net.Ba.$b.Mo,xd=olympe.net.Ba.$b.Av,yd=olympe.net.Ba.$b.Ml;function zd(a,b){let c;return null!=(c=a.O.get(b))?c:''}function Ad(a,b,c,d=new Map){a.C.C&&cb(a.C,'com',d.set('id',`${b}`).set('channel','http').set('eventType',c))}
439
439
  function Bd(a,b,c){if(null===b)return Promise.reject('No http request to send');oc(b,{[qd]:c});const d=b.C();return rxjs.firstValueFrom(rxjs.defer(()=>new Promise((e,f)=>{a.F++;const g=a.F;if(a.H.C()){const h=b.body;a.H.debug('HTTP >',d,`body: ${'string'===typeof h?h:typeof h}`)}Ad(a,g,'request',(new Map).set('destination',b.C()).set('messageType',b.method.toString()));a.G.C(b,h=>{Ad(a,g,'reply');switch(h.Hc()){case rd:case sd:case td:var k=h.getData();a.H.C()&&a.H.debug('HTTP <',h.Hc(),`content: ${'string'===
440
- typeof k?k:typeof k}`);e(k);break;case ud:h=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;a.H.warn(h);f(new olympe.N.errors.gq(h));break;case vd:a.H.debug(`HTTP < request canceled (${b.C()}).`);e();break;case wd:case xd:h=`HTTP < request authorization denied: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Fv(h));break;case yd:h=`HTTP < requested resource not found: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Up(h));break;default:k=`HTTP < Error: ${h.Hc()}, ${h.statusText}`,
441
- a.H.error(k),500===h.Hc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.eo(k)):f(Error(k))}})})).pipe(db(olympe.N.errors.gq,(e,f)=>{a.H.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.J)))}olympe.N.ot=class{constructor(a,b,c,d,e){this.H=a;this.G=b;this.C=c;this.O=d;this.J=e;this.F=0}};function Cd(a,b,c){a.H.info('Initializing COMMUNICATION layer');if(a.H.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.H.debug(d.join('\n\t'))}Dd(a,olympe.N.Pe.zb,d=>{switch(d.c){case olympe.N.Fj.Bv:a.H.error('Unknown message sent to the server:',olympe.N.Va.Lb[d.s]);break;case olympe.N.Fj.gt:a.H.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.hn&&Ed(a,f,d.i)})}});olympe.D.Zi(a.connected,
442
- ()=>{let d=!1;olympe.D.Zi(a.ab.C(),()=>{d&&(a.hc(),a.vb(),d=!1);kc(a.hc.bind(a),a.ad);kc(a.vb.bind(a),a.ua)},()=>{a.J=[0,0,a.J[2]];d=!0})},()=>{a.T=null;jc(a.vb.bind(a),a.ua)});c.C(()=>Fd(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.aa(()=>a.disconnect(),'Orchestrator websocket');Ya(a.O,(d,e)=>{e.throw(Error('Stream timeout'))});a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
440
+ typeof k?k:typeof k}`);e(k);break;case ud:h=`HTTP < Service provider for http request to ${b.C()} is overloaded, retry later`;a.H.warn(h);f(new olympe.N.errors.hq(h));break;case vd:a.H.debug(`HTTP < request canceled (${b.C()}).`);e();break;case wd:case xd:h=`HTTP < request authorization denied: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Gv(h));break;case yd:h=`HTTP < requested resource not found: ${b.C()}`;a.H.error(h);f(new olympe.N.errors.Vp(h));break;default:k=`HTTP < Error: ${h.Hc()}, ${h.statusText}`,
441
+ a.H.error(k),500===h.Hc()&&'Connection refused'===h.statusText?f(new olympe.N.errors.eo(k)):f(Error(k))}})})).pipe(db(olympe.N.errors.hq,(e,f)=>{a.H.warn(`Service overloaded (${d}), retry sending http request after ${f}ms.`)},a.K)))}olympe.N.pt=class{constructor(a,b,c,d,e){this.H=a;this.G=b;this.C=c;this.O=d;this.K=e;this.F=0}};function Cd(a,b,c){a.H.info('Initializing COMMUNICATION layer');if(a.H.C()){const d=['Server layer parameters:'];b.forEach((e,f)=>{d.push(f+'="'+e+'"')});a.H.debug(d.join('\n\t'))}Dd(a,olympe.N.Pe.zb,d=>{switch(d.c){case olympe.N.Fj.Cv:a.H.error('Unknown message sent to the server:',olympe.N.Va.Lb[d.s]);break;case olympe.N.Fj.ht:a.H.error('Fatal error, the last message is probably too big according to the websocket config.'),a.G.forEach((e,f)=>{null!==e.hn&&Ed(a,f,d.i)})}});olympe.D.Zi(a.connected,
442
+ ()=>{let d=!1;olympe.D.Zi(a.ab.C(),()=>{d&&(a.hc(),a.vb(),d=!1);kc(a.hc.bind(a),a.ad);kc(a.vb.bind(a),a.ua)},()=>{a.K=[0,0,a.K[2]];d=!0})},()=>{a.T=null;jc(a.vb.bind(a),a.ua)});c.C(()=>Fd(a)?Promise.resolve('WebSocket connection to Orchestrator OK'):Promise.reject(`WebSocket connection to Orchestrator is ${a.C}`));c.aa(()=>a.disconnect(),'Orchestrator websocket');Ya(a.O,(d,e)=>{e.throw(Error('Stream timeout'))});a.H.log('DONE initializing SERVER layer (waiting for NET layer connection to be opened)')}
443
443
  function Fd(a){return a.C===olympe.N.Va.C.bh}
444
- function P(a,b){if(a.C!==b)switch(a.H.debug('State change '+a.C+' --\x3e '+b),a.C=b,a.Ib.forEach(c=>c(b)),b){case olympe.N.Va.C.um:case olympe.N.Va.C.CONNECTING:case olympe.N.Va.C.uo:break;case olympe.N.Va.C.bh:a.connected.update(olympe.D.fa.F);break;case olympe.N.Va.C.zg:a.J=[0,0,a.J[2]];Gd(a);break;case olympe.N.Va.C.zb:a.H.error('Connection to server',a.aa.C(),'aborted due to error');a.connected.update(olympe.D.fa.C);break;case olympe.N.Va.C.yn:Gd(a);break;case olympe.N.Va.C.$d:a.connected.update(olympe.D.fa.C);
444
+ function P(a,b){if(a.C!==b)switch(a.H.debug('State change '+a.C+' --\x3e '+b),a.C=b,a.Ib.forEach(c=>c(b)),b){case olympe.N.Va.C.um:case olympe.N.Va.C.CONNECTING:case olympe.N.Va.C.uo:break;case olympe.N.Va.C.bh:a.connected.update(olympe.D.fa.F);break;case olympe.N.Va.C.zg:a.K=[0,0,a.K[2]];Gd(a);break;case olympe.N.Va.C.zb:a.H.error('Connection to server',a.aa.C(),'aborted due to error');a.connected.update(olympe.D.fa.C);break;case olympe.N.Va.C.yn:Gd(a);break;case olympe.N.Va.C.$d:a.connected.update(olympe.D.fa.C);
445
445
  break;default:throw Error('State machine error in server manager. Should not get in state '+b);}}
446
- function Hd(a){const b=olympe.N.Va.C.yn,c=olympe.N.Va.C.um,d=olympe.N.Va.C.$d,e=mc(a.kb);a.H.info(`Trying to wakeup orchestrator with ${e}`);P(a,c);const f=a.Ub.G(a.kb);f.aa(g=>{const h=JSON.parse(g);a.H.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':P(a,b);f.close();break;case 'asleep':a.H.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');P(a,c);break;case 'waking-up':break;default:a.H.warn(`Invalid message from ${e}: ${g}`),f.close(),
446
+ function Hd(a){const b=olympe.N.Va.C.yn,c=olympe.N.Va.C.um,d=olympe.N.Va.C.$d,e=mc(a.kb);a.H.info(`Trying to wakeup orchestrator with ${e}`);P(a,c);const f=a.Vb.G(a.kb);f.aa(g=>{const h=JSON.parse(g);a.H.info(`${e}: ${null==h?void 0:h.status}`);switch(null==h?void 0:h.status){case 'ready':P(a,b);f.close();break;case 'asleep':a.H.info(`Trying to wakeup orchestrator with ${e}`);f.send('{"action": "wakeup"}');P(a,c);break;case 'waking-up':break;default:a.H.warn(`Invalid message from ${e}: ${g}`),f.close(),
447
447
  P(a,d)}});f.F(()=>{a.H.warn(`Communication with ${e} failed.`);f.close();P(a,d)});f.ea(()=>{a.H.info(`Checking orchestrator status with ${e}`);f.send('{"action": "status"}')})}function Id(a,b,c,d=!1){const e=f=>{if(0===b.length||b.includes(f))d&&a.Ib.delete(e),c(f)};a.Ib.add(e);e(a.C)}function Jd(a,b,c,d,e){a.ea.C&&cb(a.ea,'com',d.set('id',`${b}`).set('channel','ws').set('eventType',c),e)}
448
- function Gd(a){const b=olympe.N.Va.C.INIT,c=olympe.N.Va.C.CONNECTING,d=olympe.N.Va.C.bh,e=olympe.N.Va.C.$d,f=olympe.N.Va.C.zg,g=olympe.N.Va.C.um,h=olympe.N.Va.C.zb;null!==a.F&&(a.F.Z(null),a.F.close());a.H.log(`Asking NET layer for a connection to ${lc(a.aa)}:${a.aa.port}...`);a.F=a.Ub.G(a.aa);a.F.ea(a.Td.bind(a));a.F.aa(a.yf.bind(a));a.F.Z(()=>{a.F=null;a.C===d?P(a,f):a.C!==h&&a.C!==g&&P(a,e)});a.kb&&a.C===b&&a.F.F(()=>{a.F.F(null);a.C===c&&Hd(a);a.kb=null});a.C!==f&&P(a,c)}
448
+ function Gd(a){const b=olympe.N.Va.C.INIT,c=olympe.N.Va.C.CONNECTING,d=olympe.N.Va.C.bh,e=olympe.N.Va.C.$d,f=olympe.N.Va.C.zg,g=olympe.N.Va.C.um,h=olympe.N.Va.C.zb;null!==a.F&&(a.F.Z(null),a.F.close());a.H.log(`Asking NET layer for a connection to ${lc(a.aa)}:${a.aa.port}...`);a.F=a.Vb.G(a.aa);a.F.ea(a.Td.bind(a));a.F.aa(a.zf.bind(a));a.F.Z(()=>{a.F=null;a.C===d?P(a,f):a.C!==h&&a.C!==g&&P(a,e)});a.kb&&a.C===b&&a.F.F(()=>{a.F.F(null);a.C===c&&Hd(a);a.kb=null});a.C!==f&&P(a,c)}
449
449
  function Kd(a,b,c,d){const e=a.De;a.De++;c={message:{seqId:e,messageFamily:b,payload:c},Dm:d?Ld(d):null,hn:null};a.G.set(e,c);Jd(a,e,'publish',(new Map).set('family',b));d=[olympe.N.Va.C.CONNECTING,olympe.N.Va.C.zg];(Fd(a)||b===olympe.N.Pe.Bj&&d.includes(a.C))&&Md(a,e,c)}
450
- function Ld(a){const b=olympe.N.Va.F.Di;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.N.Va.Lb[e]?`Status code = ${e} [${olympe.N.Va.Lb[e]}]`:`Status code = ${e}`;e=olympe.N.errors.Gq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.N.errors.fk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
451
- function Md(a,b,c){var d=c.message;a.H.C()&&a.H.debug('WS >',JSON.stringify(d.payload));(d=a.F.send(JSON.stringify(d)))?null===c.Dm?a.G.delete(b):c.hn=Date.now():olympe.D.Ma(a.ab.C()).valueOf()&&P(a,olympe.N.Va.C.zg);return d}function Dd(a,b,c,d){void 0===d&&(d=olympe.Y.Mc());let e=a.ka.get(b);void 0===e&&(e=new Map,a.ka.set(b,e));e.set(d,c)}function Nd(a){a=a.ka.get(olympe.N.Pe.ug);void 0!==a&&a.delete('logoutHandler')}
452
- function Ed(a,b,c){if(a.G.has(b)){const {Dm:d}=a.G.get(b);a.G.delete(b);null==d||d({s:olympe.N.Va.F.zt,error:c})}}function Od(a,b){a.H.error(b);P(a,olympe.N.Va.C.zb)}function Pd(a,b,c){a.Bc=c?1E3*c:-1;a.H.info(`Connected to ${a.aa.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!Md(a,d,e))return;P(a,olympe.N.Va.C.bh)}
453
- function Qd(a,b){const c=olympe.N.Ae.ng,d=olympe.N.Ae.Qf,e=olympe.N.Ae.zb,{id:f,e:g}=b;let h=a.O.get(f);h||(h=new olympe.N.fq(()=>a.O.delete(f)),a.O.set(f,h));if(g===c){Wa(a.O.C,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}`))}
454
- olympe.N.Va=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Ub=b;this.aa=e;this.F=null;this.kb=f;this.ea=g;this.ad=h.get('pingInterval');this.ua=h.get('messageTimeout');this.Z=olympe.Y.vf.parse(h.get('clientVersion'));this.Fa=olympe.Y.vf.parse(h.get('serverVersion'));this.C=olympe.N.Va.C.INIT;this.ab=d;this.bc=h.get('getContextMode');this.De=1;this.T=null;this.J=[0,0,0];this.ka=new Map;this.connected=olympe.D.ic(olympe.D.fa,'Server is connected');this.Ib=new Set;this.G=new Map;this.O=new olympe.Y.Ah(this.ua);
455
- this.Tc=new Map;this.Bc=-1;Cd(this,h,c)}connect(){const a=olympe.N.Va.C.bh,b=olympe.N.Va.C.$d,c=olympe.N.Va.C.zb,d=olympe.N.Va.C.INIT;return new Promise((e,f)=>{this.C!==d&&this.C!==b||Gd(this);Id(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.N.Va.C.uo,d=olympe.N.Va.C.$d,e=olympe.N.Va.C.CONNECTING,f=olympe.N.Va.C.zb;this.C===olympe.N.Va.C.bh||this.C===e||this.C===c?(Id(this,[d,f],g=>{g===d?
456
- a():b(Error('Was not able to disconnect'))},!0),this.C!==c&&(P(this,c),this.F.close())):(P(this,d),a())})}Td(){this.H.debug('Websocket connected, sending handshake. Client version:',pb(this.Z),'subscribeEverything:',this.bc?'NO':'YES');Kd(this,olympe.N.Pe.Bj,{c:olympe.N.Fj.Bj,cv:pb(this.Z),m:this.bc?0:1,s:this.T,b:this.ab.F()},this.Mh.bind(this))}Mh(a,b){if(a)Od(this,'Error in receiving handshake response: '+a.message);else{this.H.debug('Handshake response received');var c=olympe.N.Va.G;a=b.sv||'undefined';
457
- var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.At:Od(this,`Framework version (${pb(this.Z)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.rv:Od(this,`Framework version (${pb(this.Z)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.jt:Od(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Fa.Ga(olympe.Y.vf.C))this.H.warn('Handshake successful but received server version',
458
- a,'is invalid. Cannot check against it');else try{var e=olympe.Y.vf.parse(a);if(e.gj(this.Fa)){Od(this,`Framework v${pb(this.Z)} is expecting Orchestrator to be at least in v${pb(this.Fa)}`);return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',pb(this.Fa))}catch(f){Od(this,f);return}e=olympe.N.Va.C.$d;if(this.C===olympe.N.Va.C.zg&&null!==this.T&&this.T!==b.sessionId)this.H.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),
459
- P(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Tc.set(f,g);this.T=b.sessionId||null;Pd(this,a,d)}}}hc(){this.J[0]-this.J[1]>this.ad/2?(this.H.debug('Ping did not get answer, try to reconnect'),P(this,olympe.N.Va.C.zg)):(this.J[0]=Date.now(),this.F.send('ping')||(this.H.debug('Impossible to send ping, try to reconnect'),P(this,olympe.N.Va.C.zg)))}yf(a){this.J[2]=Date.now();if(a.startsWith('pong'))return olympe.D.Ma(this.ab.C()).valueOf()&&(this.J[1]=this.J[2]),null;
460
- var b=0;this.ea.C&&(b=performance.now()-this.ea.F);try{var c=JSON.parse(a)}catch(g){return this.H.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=c.seqId;var d=c.stream;const e=c.messageFamily;c=c.payload;if(this.H.C()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.N.Ae.ng?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.N.Ae.Qf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.H.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Jd(this,a,'consumed',
450
+ function Ld(a){const b=olympe.N.Va.F.Di;return c=>{if(null!==c&&void 0!==c){var d=null,e=c.s;if(void 0!==e&&e!==b){d=void 0!==olympe.N.Va.Lb[e]?`Status code = ${e} [${olympe.N.Va.Lb[e]}]`:`Status code = ${e}`;e=olympe.N.errors.Hq;const f=c.error;'string'===typeof f&&0<f.length&&(f.includes('Message timeout')&&(e=olympe.N.errors.fk),d+=`\nReason:\n${f}`);d=new e('Rejected by orchestrator:\n'+d)}a(d,c)}}}
451
+ function Md(a,b,c){var d=c.message;a.H.C()&&a.H.debug('WS >',JSON.stringify(d.payload));(d=a.F.send(JSON.stringify(d)))?null===c.Dm?a.G.delete(b):c.hn=Date.now():olympe.D.Ma(a.ab.C()).valueOf()&&P(a,olympe.N.Va.C.zg);return d}function Dd(a,b,c,d){void 0===d&&(d=olympe.Y.Nc());let e=a.ka.get(b);void 0===e&&(e=new Map,a.ka.set(b,e));e.set(d,c)}function Nd(a){a=a.ka.get(olympe.N.Pe.ug);void 0!==a&&a.delete('logoutHandler')}
452
+ function Ed(a,b,c){if(a.G.has(b)){const {Dm:d}=a.G.get(b);a.G.delete(b);null==d||d({s:olympe.N.Va.F.At,error:c})}}function Od(a,b){a.H.error(b);P(a,olympe.N.Va.C.zb)}function Pd(a,b,c){a.Cc=c?1E3*c:-1;a.H.info(`Connected to ${a.aa.C()}`,'|',b?`server version: ${b}`:'','|',null!==c?`activity timeout: ${c}s`:'');b=Array.from(a.G).sort(([d],[e])=>d-e);for(const [d,e]of b)if(!Md(a,d,e))return;P(a,olympe.N.Va.C.bh)}
453
+ function Qd(a,b){const c=olympe.N.Ae.ng,d=olympe.N.Ae.Rf,e=olympe.N.Ae.zb,{id:f,e:g}=b;let h=a.O.get(f);h||(h=new olympe.N.gq(()=>a.O.delete(f)),a.O.set(f,h));if(g===c){Wa(a.O.C,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}`))}
454
+ olympe.N.Va=class{constructor(a,b,c,d,e,f,g,h){this.H=a;this.Vb=b;this.aa=e;this.F=null;this.kb=f;this.ea=g;this.ad=h.get('pingInterval');this.ua=h.get('messageTimeout');this.Z=olympe.Y.wf.parse(h.get('clientVersion'));this.Fa=olympe.Y.wf.parse(h.get('serverVersion'));this.C=olympe.N.Va.C.INIT;this.ab=d;this.bc=h.get('getContextMode');this.De=1;this.T=null;this.K=[0,0,0];this.ka=new Map;this.connected=olympe.D.ic(olympe.D.fa,'Server is connected');this.Ib=new Set;this.G=new Map;this.O=new olympe.Y.Bh(this.ua);
455
+ this.Uc=new Map;this.Cc=-1;Cd(this,h,c)}connect(){const a=olympe.N.Va.C.bh,b=olympe.N.Va.C.$d,c=olympe.N.Va.C.zb,d=olympe.N.Va.C.INIT;return new Promise((e,f)=>{this.C!==d&&this.C!==b||Gd(this);Id(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.N.Va.C.uo,d=olympe.N.Va.C.$d,e=olympe.N.Va.C.CONNECTING,f=olympe.N.Va.C.zb;this.C===olympe.N.Va.C.bh||this.C===e||this.C===c?(Id(this,[d,f],g=>{g===d?
456
+ a():b(Error('Was not able to disconnect'))},!0),this.C!==c&&(P(this,c),this.F.close())):(P(this,d),a())})}Td(){this.H.debug('Websocket connected, sending handshake. Client version:',pb(this.Z),'subscribeEverything:',this.bc?'NO':'YES');Kd(this,olympe.N.Pe.Bj,{c:olympe.N.Fj.Bj,cv:pb(this.Z),m:this.bc?0:1,s:this.T,b:this.ab.F()},this.Nh.bind(this))}Nh(a,b){if(a)Od(this,'Error in receiving handshake response: '+a.message);else{this.H.debug('Handshake response received');var c=olympe.N.Va.G;a=b.sv||'undefined';
457
+ var d=b.activityTimeout?Math.max(b.activityTimeout-60,5):null;switch(b.status){case c.Bt:Od(this,`Framework version (${pb(this.Z)}) provided to the orchestrator was not valid. See orchestrator logs for more info.`);return;case c.tv:Od(this,`Framework version (${pb(this.Z)}) is not compatible with the orchestrator in use. See orchestrator logs for more info.`);return;case c.kt:Od(this,'Handshake failed. See orchestrator logs for more info.');return}if(this.Fa.Ga(olympe.Y.wf.C))this.H.warn('Handshake successful but received server version',
458
+ a,'is invalid. Cannot check against it');else try{var e=olympe.Y.wf.parse(a);if(e.gj(this.Fa)){Od(this,`Framework v${pb(this.Z)} is expecting Orchestrator to be at least in v${pb(this.Fa)}`);return}this.H.log('Handshake successful. Orchestrator version: ',e,'required:',pb(this.Fa))}catch(f){Od(this,f);return}e=olympe.N.Va.C.$d;if(this.C===olympe.N.Va.C.zg&&null!==this.T&&this.T!==b.sessionId)this.H.warn('Trying to do a session recovering, but got another session id so retry from disconnected state'),
459
+ P(this,e);else{if(e=b.identityProviders)for(const [f,g]of Object.entries(e))this.Uc.set(f,g);this.T=b.sessionId||null;Pd(this,a,d)}}}hc(){this.K[0]-this.K[1]>this.ad/2?(this.H.debug('Ping did not get answer, try to reconnect'),P(this,olympe.N.Va.C.zg)):(this.K[0]=Date.now(),this.F.send('ping')||(this.H.debug('Impossible to send ping, try to reconnect'),P(this,olympe.N.Va.C.zg)))}zf(a){this.K[2]=Date.now();if(a.startsWith('pong'))return olympe.D.Ma(this.ab.C()).valueOf()&&(this.K[1]=this.K[2]),null;
460
+ var b=0;this.ea.C&&(b=performance.now()-this.ea.F);try{var c=JSON.parse(a)}catch(g){return this.H.error('Unable to parse response from server: '+g.toString()),Error('Unable to parse response from server')}a=c.seqId;var d=c.stream;const e=c.messageFamily;c=c.payload;if(this.H.C()){const g=({id:h,i:k,e:l,c:n})=>l===olympe.N.Ae.ng?`stream[${h}][${k}]: ${JSON.stringify(n)}`:l===olympe.N.Ae.Rf?`stream[${h}]:END`:`stream[${h}]:ERROR`;this.H.debug(`WS < ${JSON.stringify(c)}, ${d?g(d):''}`)}Jd(this,a,'consumed',
461
461
  new Map,b);Jd(this,a,'deserialized',(new Map).set('family',e));if(void 0!==d){var f=d.id;b=this.O.has(f);Qd(this,d);if(b)return null;d=this.O.get(f);if(!d)return this.H.error(`Received a stream chunk for an unknown stream id: ${f}`),null;f=d.stream}this.G.has(a)&&({Dm:d}=this.G.get(a),this.G.delete(a),null==d||d(c,f));a=this.ka.get(e);if(void 0!==a)for(const g of a.values())g(c,f);return null}vb(){const a=Date.now();for(const [b,{hn:c}]of this.G)null!==c&&a-c>this.ua&&(this.H.warn(`No response was received from the server for the seqId = ${b}`),
462
- Ed(this,b,'Message timeout: never receive acknowledge'))}};function dd(a){return olympe.D.Ma(a.C)===olympe.N.rc.C.yi}
463
- function Rd(a,b){const c=olympe.N.rc.C.Ul,d=olympe.N.rc.C.de,e=olympe.N.rc.C.$d,f=olympe.N.rc.C.ev,g=b.get('reconnectionDelay');Id(a.G,[olympe.N.Va.C.INIT],()=>{Sd(a)?(a.C.update(c),a.connect().catch(h=>a.H.error(h))):a.G.disconnect().catch(h=>a.H.error(h))},!0);Id(a.G,[olympe.N.Va.C.$d],()=>{if(olympe.D.Ma(a.C)===f)a.H.info('Disconnected, from orchestrator for shutdown');else if(a.C.update(a.F?d:e),Sd(a)&&a.O){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.F?a.H.log(h):a.H.error(h);
464
- setTimeout(()=>a.connect().catch(k=>a.H.error(k)),g)}else a.H.info('Disconnected, stay offline.')});a.T.F(()=>{a.C.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Sd(a){return null===a.storage.get(a.J+'olympe_manual_offline')}
465
- olympe.N.rc=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.T=d;this.storage=e;this.C=olympe.D.ic(Number).update(olympe.N.rc.C.INIT);this.F=f.get('offlineEnabled');this.O=f.get('offlineAutoBackOnline');this.J=f.get('storagePrefix');Rd(this,f)}cg(){const a=olympe.N.rc.C.yi,b=olympe.N.rc.C.de,c=olympe.N.rc.C.$d;let d=olympe.D.fa.C;return olympe.D.va([this.C],e=>{if(e===a)d=olympe.D.fa.F;else if(e===b||e===c)d=olympe.D.fa.C;return d},olympe.D.fa)}getState(){return this.C.tb()}connect(){const a=
466
- this;return v(function*(){const b=olympe.N.rc.C.yi,c=olympe.N.rc.C.Ul;olympe.D.Ma(a.C)!==b&&(a.C.update(c),a.storage.delete(a.J+'olympe_manual_offline'),yield a.G.connect(),yield Td(),a.C.update(b))})}disconnect(){const a=this;return v(function*(){const b=olympe.N.rc.C.de,c=olympe.N.rc.C.Ul;if(!a.F)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.D.Ma(a.C)!==b&&
467
- (a.C.update(c),yield olympe.N.Oh().disconnect(),yield a.G.disconnect())})}};olympe.N.rc.C={INIT:0,Ul:1,yi:2,de:3,$d:4,ev:5};olympe.N.rc.F='olympe_manual_offline';olympe.N.cb=class{constructor(a,b,c,d,e){this.be=c;this.F=a;this.source=b;this.messageType=d;this.C=null!=e?e:null}static F(a,b,c){var d=olympe.N.cb,e=a.dest,f=a.src,g=a.seq,h=a.type;b.T=c;return new d(e,f,g,h,b.J(a.content))}pc(){return this.F}sb(){return this.source}getType(){return this.messageType}ha(a,b){var c=this.F,d=this.source,e=this.be,f=this.messageType;a.Z=b;return{dest:c,src:d,seq:e,type:f,content:a.ha(this.C)}}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.be}, type: ${this.messageType})`}};
468
- olympe.N.cb.C={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,ir:4,Wf:5,nm:6,zb:7,Lk:10,Mq:11,br:12,we:13,sm:14};olympe.N.bk=class extends olympe.N.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.G=c}static F(a,b,c){var d=olympe.N.bk,e=a.dest,f=a.src,g=a.auth,h=a.seq,k=a.type;b.T=c;return new d(e,f,g,h,k,b.J(a.content))}ne(){return this.G}ha(a,b){return Object.assign(super.ha(a,b),{auth:this.G})}};olympe.N.bk.Fj={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,we:4,sm:5};const Ud=olympe.N.cb.C.SEND,Vd=olympe.N.cb.C.GET,Wd=olympe.N.cb.C.SUBSCRIBE,Xd=olympe.N.cb.C.we,Yd=olympe.N.cb.C.Mq,Zd=olympe.N.cb.C.zb,$d=olympe.N.cb.C.ir,ae=olympe.N.cb.C.nm,be=olympe.N.cb.C.br;
469
- olympe.N.Sc=class{constructor(a,b,c){this.C=a;this.F=b;this.J=c;this.G=null}Wh(){return null!==this.G?Promise.resolve(this.G):od(this.F,this.C).then(a=>this.G=a)}es(){return this.C.getType()}source(){return this.C.sb()}body(){return this.C.C}ur(){return this.C.getType()===Ud?this.F.qd(this.C,Yd):Promise.reject('Should only call `ack` on SEND requests')}qd(a){const b=this.C.getType();return b===Vd||b===Xd?this.F.qd(this.C,$d,a):Promise.reject('Should only call `reply` on GET requests')}cn(a){if(this.C.getType()!==
470
- Wd)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.Mc();return new Promise((c,d)=>{const e={seq:jd(this.F,f=>{switch(f.getType()){case be:ce(this.J,b);c(b);break;case Zd:d(f.C.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.F.Tc};this.F.qd(this.C,ae,e).catch(d)})}Lh(a){return this.F.qd(this.C,Zd,{reason:a.message})}};olympe.N.Sc.prototype.fail=olympe.N.Sc.prototype.Lh;
471
- olympe.N.Sc.prototype.notifyOn=olympe.N.Sc.prototype.cn;olympe.N.Sc.prototype.reply=olympe.N.Sc.prototype.qd;olympe.N.Sc.prototype.ack=olympe.N.Sc.prototype.ur;olympe.N.Sc.prototype.body=olympe.N.Sc.prototype.body;olympe.N.Sc.prototype.source=olympe.N.Sc.prototype.source;olympe.N.Sc.prototype.requestType=olympe.N.Sc.prototype.es;olympe.N.Sc.prototype.userTag=olympe.N.Sc.prototype.Wh;function Vc(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function bd(a,b){b&&a.cf();null===a.F&&(a.F=setInterval(a.cf.bind(a),a.G))}function nd(a,b){b=a.C.delete(b);0===a.C.size&&Vc(a);return b}function de(a,b){a.C.forEach((c,d)=>{nd(a,d);c(b)})}
472
- olympe.N.pv=class{constructor(a,b,c,d){this.H=a;this.J=b;this.O=c;this.G=d;this.C=new Map;this.F=null}cf(){const a=olympe.N.errors.Hj;cd(this.J)?this.J.request(this.O,olympe.N.cb.C.we,Array.from(this.C.keys())).then(b=>{b=b.C;0<b.length&&b.forEach(c=>{const d=this.C.get(c);nd(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.H.error(b);de(this,Error(b))}):Vc(this)}};function Q(a,b){return{t:a,v:b}}
473
- olympe.N.fc=class{constructor(){this.T=this.Z=null}ha(a){a=this.F(a);this.Z=null;return a}J(a){a=this.C(a);this.T=null;return a}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.ib:return Q(olympe.N.fc.C.hl,a.valueOf().toISOString());case a instanceof Date:return Q(olympe.N.fc.C.hl,a.toISOString());case a instanceof olympe.D.Color:return Q(olympe.N.fc.C.COLOR,a.toJSON());case a instanceof
474
- Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.F(d)])),Q(olympe.N.fc.C.Hp,a);case a instanceof Set:return a=Array.from(a).map(this.F.bind(this)),Q(olympe.N.fc.C.Eg,a);case Array.isArray(a):return a.map(this.F.bind(this));case a instanceof ArrayBuffer:return a=olympe.Y.Ye().C(new Uint8Array(a)),Q(olympe.N.fc.C.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.Y.Ye().C(a),Q(olympe.N.fc.C.Ji,a);case a instanceof olympe.Y.stream.Bg:if(!this.Z)throw Error('No stream handler has been set, so cannot serialize the stream.');
475
- let b;return Q(olympe.N.fc.C.Wf,null==(b=this.Z)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.F(e);return c},{}),Q(olympe.N.fc.C.Vp,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(d=>this.C(d));if('object'!==typeof a)throw new olympe.N.errors.zo(`Impossible to deserialize the following value: ${a}`);
476
- const {t:b,v:c}=a;switch(b){case olympe.N.fc.C.hl:return new Date(c);case olympe.N.fc.C.COLOR:return olympe.D.Color.Vb(c);case olympe.N.fc.C.Hp:return new Map(Object.entries(c).map(([e,f])=>[e,this.C(f)]));case olympe.N.fc.C.Eg:return new Set(c.map(e=>this.C(e)));case olympe.N.fc.C.ARRAY_BUFFER:return olympe.Y.Ye().F(c).buffer;case olympe.N.fc.C.Ji:return olympe.Y.Ye().F(c);case olympe.N.fc.C.Wf:if(!this.T)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==
477
- (d=this.T)?void 0:d.call(this,c);case olympe.N.fc.C.Vp:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.C(g);return e},{});default:throw new olympe.N.errors.zo(`Impossible to deserialize the following value: ${c}`);}}};olympe.N.fc.C={hl:1,COLOR:2,Hp:3,Eg:4,ARRAY_BUFFER:5,Ji:6,Wf:7,Vp:8};const ee=olympe.N.cb.C.SEND,fe=olympe.N.cb.C.GET,ge=olympe.N.cb.C.PUBLISH,he=olympe.N.cb.C.SUBSCRIBE,ie=olympe.N.cb.C.we,je=olympe.N.cb.C.sm,ke=olympe.N.cb.C.Mq,le=olympe.N.cb.C.Lk,me=olympe.N.cb.C.zb,ne=olympe.N.cb.C.ir,oe=olympe.N.cb.C.nm;function ce(a,b){a.C||(a.C=Xa(new olympe.Y.pm(a.F.Tc+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
478
- function pe(a,b){const c=olympe.N.cb.C.nm,d=olympe.N.cb.C.br;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.C.seq,b.sb(),d)}function qe(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.fk(a):Error(a)}
479
- olympe.N.yb=class{constructor(a,b){this.F=olympe.N.Oh();this.J=a;this.G=this.C=null;this.O=new olympe.D.Zb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ma.gb(`Service ${this.J}`)}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Oh();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&md(f,a,k);h&&kd(f,h).catch(n=>olympe.ma.gb('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(l);f.request(a,he,c,d.timeout).then(n=>
462
+ Ed(this,b,'Message timeout: never receive acknowledge'))}};function dd(a){return olympe.D.Ma(a.C)===olympe.N.tc.C.zi}
463
+ function Rd(a,b){const c=olympe.N.tc.C.Ul,d=olympe.N.tc.C.de,e=olympe.N.tc.C.$d,f=olympe.N.tc.C.fv,g=b.get('reconnectionDelay');Id(a.G,[olympe.N.Va.C.INIT],()=>{Sd(a)?(a.C.update(c),a.connect().catch(h=>a.H.error(h))):a.G.disconnect().catch(h=>a.H.error(h))},!0);Id(a.G,[olympe.N.Va.C.$d],()=>{if(olympe.D.Ma(a.C)===f)a.H.info('Disconnected, from orchestrator for shutdown');else if(a.C.update(a.F?d:e),Sd(a)&&a.O){const h=`Disconnected, will try to auto reconnect in ${g} ms`;a.F?a.H.log(h):a.H.error(h);
464
+ setTimeout(()=>a.connect().catch(k=>a.H.error(k)),g)}else a.H.info('Disconnected, stay offline.')});a.T.F(()=>{a.C.update(f);return Promise.resolve()},'Connectivity manager: shutdown state')}function Sd(a){return null===a.storage.get(a.K+'olympe_manual_offline')}
465
+ olympe.N.tc=class{constructor(a,b,c,d,e,f){this.H=a;this.G=b;this.T=d;this.storage=e;this.C=olympe.D.ic(Number).update(olympe.N.tc.C.INIT);this.F=f.get('offlineEnabled');this.O=f.get('offlineAutoBackOnline');this.K=f.get('storagePrefix');Rd(this,f)}cg(){const a=olympe.N.tc.C.zi,b=olympe.N.tc.C.de,c=olympe.N.tc.C.$d;let d=olympe.D.fa.C;return olympe.D.va([this.C],e=>{if(e===a)d=olympe.D.fa.F;else if(e===b||e===c)d=olympe.D.fa.C;return d},olympe.D.fa)}getState(){return this.C.tb()}connect(){const a=
466
+ this;return v(function*(){const b=olympe.N.tc.C.zi,c=olympe.N.tc.C.Ul;olympe.D.Ma(a.C)!==b&&(a.C.update(c),a.storage.delete(a.K+'olympe_manual_offline'),yield a.G.connect(),yield Td(),a.C.update(b))})}disconnect(){const a=this;return v(function*(){const b=olympe.N.tc.C.de,c=olympe.N.tc.C.Ul;if(!a.F)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.K+'olympe_manual_offline','true');olympe.D.Ma(a.C)!==b&&
467
+ (a.C.update(c),yield olympe.N.Ph().disconnect(),yield a.G.disconnect())})}};olympe.N.tc.C={INIT:0,Ul:1,zi:2,de:3,$d:4,fv:5};olympe.N.tc.F='olympe_manual_offline';olympe.N.cb=class{constructor(a,b,c,d,e){this.be=c;this.F=a;this.source=b;this.messageType=d;this.C=null!=e?e:null}static F(a,b,c){var d=olympe.N.cb,e=a.dest,f=a.src,g=a.seq,h=a.type;b.T=c;return new d(e,f,g,h,b.O(a.content))}pc(){return this.F}sb(){return this.source}getType(){return this.messageType}ha(a,b){var c=this.F,d=this.source,e=this.be,f=this.messageType;a.Z=b;return{dest:c,src:d,seq:e,type:f,content:a.ha(this.C)}}toString(){return`Message(dest: ${this.F}, src: ${this.source}, seqId: ${this.be}, type: ${this.messageType})`}};
468
+ olympe.N.cb.C={SEND:0,GET:1,SUBSCRIBE:2,PUBLISH:3,jr:4,Wf:5,nm:6,zb:7,Lk:10,Nq:11,cr:12,ve:13,sm:14};olympe.N.bk=class extends olympe.N.cb{constructor(a,b,c,d,e,f){super(a,b,d,e,f);this.G=c}static F(a,b,c){var d=olympe.N.bk,e=a.dest,f=a.src,g=a.auth,h=a.seq,k=a.type;b.T=c;return new d(e,f,g,h,k,b.O(a.content))}me(){return this.G}ha(a,b){return Object.assign(super.ha(a,b),{auth:this.G})}};olympe.N.bk.Fj={SEND:0,GET:1,PUBLISH:2,SUBSCRIBE:3,ve:4,sm:5};const Ud=olympe.N.cb.C.SEND,Vd=olympe.N.cb.C.GET,Wd=olympe.N.cb.C.SUBSCRIBE,Xd=olympe.N.cb.C.ve,Yd=olympe.N.cb.C.Nq,Zd=olympe.N.cb.C.zb,$d=olympe.N.cb.C.jr,ae=olympe.N.cb.C.nm,be=olympe.N.cb.C.cr;
469
+ olympe.N.Tc=class{constructor(a,b,c){this.C=a;this.F=b;this.K=c;this.G=null}Xh(){return null!==this.G?Promise.resolve(this.G):od(this.F,this.C).then(a=>this.G=a)}gs(){return this.C.getType()}source(){return this.C.sb()}body(){return this.C.C}vr(){return this.C.getType()===Ud?this.F.qd(this.C,Yd):Promise.reject('Should only call `ack` on SEND requests')}qd(a){const b=this.C.getType();return b===Vd||b===Xd?this.F.qd(this.C,$d,a):Promise.reject('Should only call `reply` on GET requests')}cn(a){if(this.C.getType()!==
470
+ Wd)return Promise.reject('Should only call `notifyOn` on SUBSCRIBE requests');const b=olympe.Y.Nc();return new Promise((c,d)=>{const e={seq:jd(this.F,f=>{switch(f.getType()){case be:ce(this.K,b);c(b);break;case Zd:d(f.C.reason);break;default:d('Unsupported response type for a SUBSCRIBE request')}}),topic:a,id:b,refresh:this.F.Uc};this.F.qd(this.C,ae,e).catch(d)})}Mh(a){return this.F.qd(this.C,Zd,{reason:a.message})}};olympe.N.Tc.prototype.fail=olympe.N.Tc.prototype.Mh;
471
+ olympe.N.Tc.prototype.notifyOn=olympe.N.Tc.prototype.cn;olympe.N.Tc.prototype.reply=olympe.N.Tc.prototype.qd;olympe.N.Tc.prototype.ack=olympe.N.Tc.prototype.vr;olympe.N.Tc.prototype.body=olympe.N.Tc.prototype.body;olympe.N.Tc.prototype.source=olympe.N.Tc.prototype.source;olympe.N.Tc.prototype.requestType=olympe.N.Tc.prototype.gs;olympe.N.Tc.prototype.userTag=olympe.N.Tc.prototype.Xh;function Vc(a){if(null!==a.F){var b=a.F;a.F=null;clearInterval(b)}}function bd(a,b){b&&a.cf();null===a.F&&(a.F=setInterval(a.cf.bind(a),a.G))}function nd(a,b){b=a.C.delete(b);0===a.C.size&&Vc(a);return b}function de(a,b){a.C.forEach((c,d)=>{nd(a,d);c(b)})}
472
+ olympe.N.qv=class{constructor(a,b,c,d){this.H=a;this.K=b;this.O=c;this.G=d;this.C=new Map;this.F=null}cf(){const a=olympe.N.errors.Hj;cd(this.K)?this.K.request(this.O,olympe.N.cb.C.ve,Array.from(this.C.keys())).then(b=>{b=b.C;0<b.length&&b.forEach(c=>{const d=this.C.get(c);nd(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.H.error(b);de(this,Error(b))}):Vc(this)}};function Q(a,b){return{t:a,v:b}}
473
+ olympe.N.fc=class{constructor(){this.T=this.Z=null}ha(a){a=this.F(a);this.Z=null;return a}O(a){a=this.C(a);this.T=null;return a}F(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.fb:return Q(olympe.N.fc.C.hl,a.valueOf().toISOString());case a instanceof Date:return Q(olympe.N.fc.C.hl,a.toISOString());case a instanceof olympe.D.Color:return Q(olympe.N.fc.C.COLOR,a.toJSON());case a instanceof
474
+ Map:return a=Object.fromEntries(Array.from(a).map(([c,d])=>[c,this.F(d)])),Q(olympe.N.fc.C.Ip,a);case a instanceof Set:return a=Array.from(a).map(this.F.bind(this)),Q(olympe.N.fc.C.Eg,a);case Array.isArray(a):return a.map(this.F.bind(this));case a instanceof ArrayBuffer:return a=olympe.Y.Ye().C(new Uint8Array(a)),Q(olympe.N.fc.C.ARRAY_BUFFER,a);case a instanceof Uint8Array:return a=olympe.Y.Ye().C(a),Q(olympe.N.fc.C.Ji,a);case a instanceof olympe.Y.stream.Bg:if(!this.Z)throw Error('No stream handler has been set, so cannot serialize the stream.');
475
+ let b;return Q(olympe.N.fc.C.Wf,null==(b=this.Z)?void 0:b.call(this,a));case 'object'===typeof a:return a=Object.entries(a).reduce((c,[d,e])=>{c[d]=this.F(e);return c},{}),Q(olympe.N.fc.C.Wp,a);default:throw Error(`Impossible to serialize the following value: ${a}`);}}C(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a}if(Array.isArray(a))return a.map(d=>this.C(d));if('object'!==typeof a)throw new olympe.N.errors.zo(`Impossible to deserialize the following value: ${a}`);
476
+ const {t:b,v:c}=a;switch(b){case olympe.N.fc.C.hl:return new Date(c);case olympe.N.fc.C.COLOR:return olympe.D.Color.Qb(c);case olympe.N.fc.C.Ip:return new Map(Object.entries(c).map(([e,f])=>[e,this.C(f)]));case olympe.N.fc.C.Eg:return new Set(c.map(e=>this.C(e)));case olympe.N.fc.C.ARRAY_BUFFER:return olympe.Y.Ye().F(c).buffer;case olympe.N.fc.C.Ji:return olympe.Y.Ye().F(c);case olympe.N.fc.C.Wf:if(!this.T)throw Error('No stream handler has been set, so cannot deserialize the stream.');let d;return null==
477
+ (d=this.T)?void 0:d.call(this,c);case olympe.N.fc.C.Wp:return Object.entries(c).reduce((e,[f,g])=>{e[f]=this.C(g);return e},{});default:throw new olympe.N.errors.zo(`Impossible to deserialize the following value: ${c}`);}}};olympe.N.fc.C={hl:1,COLOR:2,Ip:3,Eg:4,ARRAY_BUFFER:5,Ji:6,Wf:7,Wp:8};const ee=olympe.N.cb.C.SEND,fe=olympe.N.cb.C.GET,ge=olympe.N.cb.C.PUBLISH,he=olympe.N.cb.C.SUBSCRIBE,ie=olympe.N.cb.C.ve,je=olympe.N.cb.C.sm,ke=olympe.N.cb.C.Nq,le=olympe.N.cb.C.Lk,me=olympe.N.cb.C.zb,ne=olympe.N.cb.C.jr,oe=olympe.N.cb.C.nm;function ce(a,b){a.C||(a.C=Xa(new olympe.Y.pm(a.F.Uc+3E4),c=>{let d;null==(d=a.G)||d.call(a,c)}));a.C.add(b)}
478
+ function pe(a,b){const c=olympe.N.cb.C.nm,d=olympe.N.cb.C.cr;return b.getType()!==c?Promise.reject('Should only call `topicAck` on TOPIC responses'):a.send(b.C.seq,b.sb(),d)}function qe(a){let b,c;a=null!=(c=null==(b=a.C)?void 0:b.reason)?c:'Unknown reason';return'Timeout'===a?new olympe.N.errors.fk(a):Error(a)}
479
+ olympe.N.yb=class{constructor(a,b){this.F=olympe.N.Ph();this.K=a;this.G=this.C=null;this.O=new olympe.D.Zb(`Service ${a}`,'function'===typeof b.F?b.F():b);this.H=olympe.ma.hb(`Service ${this.K}`)}static observe(a,b,c,d={}){const e='function'===typeof b.F?b.F():b,f=olympe.N.Ph();return(new rxjs.Observable(g=>{let h=null,k=null;const l=()=>{g.complete();k&&md(f,a,k);h&&kd(f,h).catch(n=>olympe.ma.hb('Service '+a).error('Failed to unsubscribe from a topic '+n))};e.Z(l);f.request(a,he,c,d.timeout).then(n=>
480
480
  {switch(n.getType()){case oe:const p=n.C;h=p.topic;ad(f,h,q=>{q.getType()===ge?g.next(q.C):(g.error('Unsupported notification message. It should be a publish'),l())}).then(()=>{k=p.id;ld(f,a,k,p.refresh,q=>g.error(q));pe(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 me:g.error(qe(n));break;default:g.error('Unsupported response type for a SUBSCRIBE request')}}).catch(n=>g.error(n));
481
- return l})).pipe(db(olympe.N.errors.Hj,(g,h)=>{olympe.ma.gb(`Service ${a}`).debug(`Subscribed to topic ${g.V()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}ks(a){this.G=a;return this}stop(){this.O.destroy()}clear(){kd(this.F,this.J).catch(b=>this.H.error('Failed to unsubscribe from '+this.J+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,c)})}let a;null==(a=this.C)||a.clear()}static publish(a,
482
- b){return v(function*(){yield olympe.N.Oh().request(a,ge,b)})}static send(a,b,c={}){return olympe.N.Oh().request(a,ee,b,c.timeout).then(d=>{switch(d.getType()){case ke:break;case me:throw qe(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.N.Oh().request(a,fe,b,c.timeout).then(d=>{switch(d.getType()){case ne:d=d.C;if(null!==d)return d;throw Error('No payload after request to service: '+a);case me:throw qe(d);default:throw Error('Unsupported response type for a GET request');
483
- }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);ad(this.F,this.J,c=>{const d=new olympe.N.Sc(c,this.F,this);switch(c.getType()){case ie:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Wa(h,g))});d.qd(e).catch(g=>this.H.error('Not able to validate subscription keep alive',g));break;case je:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case ge:a.next(d);break;default:this.F.qd(c,le).then(()=>a.next(d))}}).catch(c=>
484
- {c='Failed to connect to the bus: '+c;this.H.error(c);a.error(Error(c))});return b})}};olympe.N.yb.prototype.listen=olympe.N.yb.prototype.listen;olympe.N.yb.get=olympe.N.yb.get;olympe.N.yb.send=olympe.N.yb.send;olympe.N.yb.publish=olympe.N.yb.publish;olympe.N.yb.prototype.stop=olympe.N.yb.prototype.stop;olympe.N.yb.prototype.setUnsubscriptionHandler=olympe.N.yb.prototype.ks;olympe.N.yb.observe=olympe.N.yb.observe;olympe.N.fq=class{constructor(a){this.C=0;this.buffer=[];this.size=null;this.stream=new olympe.Y.stream.Bg;this.F=null!=a?a:()=>{}}write(a,b){const c=this;return v(function*(){if(b<c.C||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.C}`);for(c.buffer[b-c.C]=a;void 0!==c.buffer[0];){c.C++;const d=c.buffer.shift();yield c.stream.write(d)}c.C===c.size&&(c.F(),c.stream.complete())})}complete(a){if(null!==
485
- this.size)throw Error('The stream has already been completed');if(a<this.C+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.C+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.C===this.size&&(this.F(),this.stream.complete())}throw(a){this.F();this.stream.throw(a)}};olympe.N.Pe={ng:1,Mf:2,zb:3,ug:4,ez:5,Bj:6};olympe.N.Fj={Bj:1,Bv:2,gt:3,we:5};olympe.N.Ae={ng:0,Qf:1,zb:2};olympe.N.Va.C={INIT:'initialize',CONNECTING:'connecting',$d:'disconnected',uo:'disconnecting',bh:'connected',zg:'reconnecting',um:'waking',yn:'awake',zb:'error'};olympe.N.Va.G={rh:1,jt:-1,At:-2,rv:-3};olympe.N.Va.F={Di:0,zt:23};
481
+ return l})).pipe(db(olympe.N.errors.Hj,(g,h)=>{olympe.ma.hb(`Service ${a}`).debug(`Subscribed to topic ${g.V()} now that we are back online, after waiting for ${h}ms`);let k;null==(k=d.onRetry)||k.call(d)}))}ls(a){this.G=a;return this}stop(){this.O.destroy()}clear(){kd(this.F,this.K).catch(b=>this.H.error('Failed to unsubscribe from '+this.K+', error: '+b));if(this.G){let b;null==(b=this.C)||b.forEach(c=>{let d;return null==(d=this.G)?void 0:d.call(this,c)})}let a;null==(a=this.C)||a.clear()}static publish(a,
482
+ b){return v(function*(){yield olympe.N.Ph().request(a,ge,b)})}static send(a,b,c={}){return olympe.N.Ph().request(a,ee,b,c.timeout).then(d=>{switch(d.getType()){case ke:break;case me:throw qe(d);default:throw Error('Unsupported response type for a SEND request');}})}static get(a,b,c={}){return olympe.N.Ph().request(a,fe,b,c.timeout).then(d=>{switch(d.getType()){case ne:d=d.C;if(null!==d)return d;throw Error('No payload after request to service: '+a);case me:throw qe(d);default:throw Error('Unsupported response type for a GET request');
483
+ }})}listen(){return new rxjs.Observable(a=>{const b=()=>{a.complete();this.clear()};this.O.onDestroy(b);ad(this.F,this.K,c=>{const d=new olympe.N.Tc(c,this.F,this);switch(c.getType()){case ie:var e=d.body().filter(g=>{let h;return!(null==(h=this.C)?0:Wa(h,g))});d.qd(e).catch(g=>this.H.error('Not able to validate subscription keep alive',g));break;case je:c=d.body();null==(e=this.C)||e.delete(c);let f;null==(f=this.G)||f.call(this,c);break;case ge:a.next(d);break;default:this.F.qd(c,le).then(()=>a.next(d))}}).catch(c=>
484
+ {c='Failed to connect to the bus: '+c;this.H.error(c);a.error(Error(c))});return b})}};olympe.N.yb.prototype.listen=olympe.N.yb.prototype.listen;olympe.N.yb.get=olympe.N.yb.get;olympe.N.yb.send=olympe.N.yb.send;olympe.N.yb.publish=olympe.N.yb.publish;olympe.N.yb.prototype.stop=olympe.N.yb.prototype.stop;olympe.N.yb.prototype.setUnsubscriptionHandler=olympe.N.yb.prototype.ls;olympe.N.yb.observe=olympe.N.yb.observe;olympe.N.gq=class{constructor(a){this.C=0;this.buffer=[];this.size=null;this.stream=new olympe.Y.stream.Bg;this.F=null!=a?a:()=>{}}write(a,b){const c=this;return v(function*(){if(b<c.C||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.C}`);for(c.buffer[b-c.C]=a;void 0!==c.buffer[0];){c.C++;const d=c.buffer.shift();yield c.stream.write(d)}c.C===c.size&&(c.F(),c.stream.complete())})}complete(a){if(null!==
485
+ this.size)throw Error('The stream has already been completed');if(a<this.C+this.buffer.length)throw Error(`The stream has already reached element n\u00b0${this.C+this.buffer.length}, specified index must be greater or equal to it.`);this.size=a;this.C===this.size&&(this.F(),this.stream.complete())}throw(a){this.F();this.stream.throw(a)}};olympe.N.Pe={ng:1,Nf:2,zb:3,ug:4,fz:5,Bj:6};olympe.N.Fj={Bj:1,Cv:2,ht:3,ve:5};olympe.N.Ae={ng:0,Rf:1,zb:2};olympe.N.Va.C={INIT:'initialize',CONNECTING:'connecting',$d:'disconnected',uo:'disconnecting',bh:'connected',zg:'reconnecting',um:'waking',yn:'awake',zb:'error'};olympe.N.Va.G={rh:1,kt:-1,Bt:-2,tv:-3};olympe.N.Va.F={Di:0,At:23};
486
486
  olympe.N.Va.Lb={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',
487
- 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.N.R={ff:'com.ConnectivityManager',Wj:'com.ServerManager',Jn:'com.BusManager',wl:'com.HttpManager',ee:'com.Serializer',Ca:'com.Logger',Sq:'com.Source',cr:'com.Urls',$A:'com.peerFileSvcUrl'};
488
- olympe.N.U={jl:'defaultHost',yh:'server.host',Xj:'server.port',Yj:'server.ssl',Sk:'server.basePath',lr:'server.wsPath',$l:'server.reconnectionDelay',hq:'server.pingInterval',kr:'server.messageTimeout',Bq:'server.retryHttpOnOverload',al:'server.clientVersion',Pq:'server.serverVersion',av:'server.wakeUpService',Vk:'bus.host',Kn:'bus.path',Ln:'bus.port',Qn:'bus.vhost',On:'bus.ssl',we:'bus.keepalive',Su:'bus.reschedulePings',Js:'bus.clientId',Hs:'bus.clean',Ms:'bus.connectTimeout',Nn:'bus.shortTimeout',
489
- Mn:'bus.requestTimeout',Pn:'bus.subscriptionRefreshRate',Ou:'bus.queueQoSZero',Uk:'bus.allowGuest'};
490
- olympe.W.config(function(a){var b=['localhost','127.0.0.1'];F(a,olympe.N.U.jl,'object'===typeof window&&window.location&&window.location.hostname||b[1]);var c=a.getParameter(olympe.N.U.jl);F(a,olympe.N.U.yh,c);var d=a.getParameter(olympe.N.U.yh);const e=b.includes(d);d=e||d.endsWith(a.getParameter(olympe.net.U.Dj));F(a,olympe.N.U.Xj,e?8080:d?80:443);F(a,olympe.N.U.Yj,!d);F(a,olympe.N.U.Sk,'OlympeServer');F(a,olympe.N.U.lr,'websocket');F(a,olympe.N.U.$l,5E3);F(a,olympe.N.U.hq,5E3);F(a,olympe.N.U.kr,
491
- 3E4);F(a,olympe.N.U.Bq,4E3);F(a,olympe.N.U.Pq,'7.3.0');F(a,olympe.N.U.Vk,c);c=a.getParameter(olympe.N.U.Vk);c=(b=b.includes(c))||c.endsWith(a.getParameter(olympe.net.U.Dj));F(a,olympe.N.U.Kn,b?'':'/mqtt');F(a,olympe.N.U.Ln,b?15675:c?80:443);F(a,olympe.N.U.On,!c);F(a,olympe.N.U.Qn,b?'/':'');F(a,olympe.N.U.we,30);F(a,olympe.N.U.Nn,5E3);F(a,olympe.N.U.Mn,3E4);F(a,olympe.N.U.Pn,6E4);F(a,olympe.N.U.Uk,!1);b=a.getParameter(olympe.dg.U.No);if(void 0!==b)Na(a,olympe.N.U.al,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
492
- E(a,olympe.N.R.Ca,[olympe.ma.R.Ea],g=>g.Wc('communication'));E(a,'server.WebSocketRequest',[new olympe.W.ja(olympe.N.U.yh),new olympe.W.ja(olympe.N.U.Xj),new olympe.W.ja(olympe.N.U.Yj),new olympe.W.ja(olympe.N.U.Sk),new olympe.W.ja(olympe.N.U.lr)],(g,h,k,l,n)=>new olympe.net.Mi(g,h,(l+'/'+n).replace(/\/+/g,'/').replace(/\/$/,''),k));E(a,'server.wakeUpRequest',[new olympe.W.ja(olympe.N.U.yh),new olympe.W.ja(olympe.N.U.Xj),new olympe.W.ja(olympe.N.U.Yj),new olympe.W.ja(olympe.N.U.av)],(g,h,k,l)=>{if(null===
493
- l||void 0===l)return null;l=l.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.Mi(g,h,l,k)});const f=Array.from(Object.values(olympe.N.ac));E(a,olympe.N.R.cr,[new olympe.W.ja(olympe.N.U.yh),new olympe.W.ja(olympe.N.U.Xj),new olympe.W.ja(olympe.N.U.Yj),new olympe.W.ja(olympe.N.U.Sk),...f.map(g=>new olympe.W.ja(g))],(g,h,k,l,...n)=>{const p=f.map((q,r)=>{r=n[r];r=(new olympe.net.ki(g,h,`${l}${r?'/'+r:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).C();return[q,r]});return new Map(p)});D(a,
494
- olympe.N.R.ee,olympe.N.fc);D(a,olympe.N.R.wl,olympe.N.ot,olympe.N.R.Ca,olympe.net.R.Ea,olympe.Y.R.Sf,olympe.N.R.cr,new olympe.W.ja(olympe.N.U.Bq));E(a,'com.server.ManagerConfig',[new olympe.W.ja(olympe.N.U.hq),new olympe.W.ja(olympe.N.U.kr),new olympe.W.ja(olympe.N.U.al),new olympe.W.ja(olympe.N.U.Pq),new olympe.W.ja(olympe.dc.U.zh)],(...g)=>{const h=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],k=new Map;g.forEach((l,n)=>k.set(h[n],l));return k});D(a,olympe.N.R.Wj,
495
- olympe.N.Va,olympe.N.R.Ca,olympe.net.R.Ea,olympe.host.R.Qe,olympe.host.R.ak,'server.WebSocketRequest','server.wakeUpRequest',olympe.Y.R.Sf,'com.server.ManagerConfig');E(a,'com.bus.ManagerConfig',[new olympe.W.ja(olympe.N.U.yh),new olympe.W.ja(olympe.N.U.Vk),new olympe.W.ja(olympe.N.U.Kn),new olympe.W.ja(olympe.N.U.Ln),new olympe.W.ja(olympe.N.U.Qn),new olympe.W.ja(olympe.N.U.On),new olympe.W.ja(olympe.N.U.Uk),new olympe.W.ja(olympe.N.U.Nn),new olympe.W.ja(olympe.N.U.Mn),new olympe.W.ja(olympe.N.U.Pn),
496
- new olympe.W.ja(olympe.N.U.we),new olympe.W.ja(olympe.N.U.Su),new olympe.W.ja(olympe.N.U.Js),new olympe.W.ja(olympe.N.U.Hs),new olympe.W.ja(olympe.N.U.$l),new olympe.W.ja(olympe.N.U.Ms),new olympe.W.ja(olympe.N.U.Ou)],(g,h,k,l,n,p,q,r,t,u,...x)=>{h=`${p?'wss://':'ws://'}${h}:${l}${k}/ws`;const y='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');x=x.reduce((z,A,B)=>{z[y[B]]=A;return z},{});x.vhost=`${n||g.split('.')[0]}`;return new Map([['url',
497
- h],['connectionOptions',x],['allowGuest',q],['shortTimeout',r],['requestTimeout',t],['subscriptionsRefreshRate',u]])});D(a,olympe.N.R.Jn,olympe.N.Sn,olympe.N.R.Ca,olympe.net.R.Ea,olympe.N.R.ff,olympe.auth.R.Ea,olympe.host.R.Qe,olympe.N.R.ee,olympe.Y.R.Sf,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.R.Pl,olympe.Db.R.Fg,new olympe.W.ja(olympe.N.U.$l)],(g,...h)=>['storagePrefix','reconnectionDelay'].reduce((k,l,n)=>k.set(l,h[n]),g));D(a,olympe.N.R.ff,olympe.N.rc,olympe.N.R.Ca,
498
- olympe.N.R.Wj,olympe.net.R.Ea,olympe.host.R.Qe,olympe.Db.R.Il,'com.connectivity.ManagerConfig')},'olympe.communication');olympe.W.run([olympe.N.R.Jn,olympe.N.R.ff],(a,b)=>{olympe.N.Oh=()=>a;olympe.N.Nm=()=>b});olympe.auth={};function re(a,b){Nd(a.C);Dd(a.C,olympe.N.Pe.ug,c=>{const d=c.c;d===olympe.auth.kd.C.hu?(a.C.Td(),b(olympe.auth.Sa.F.ij,c)):d===olympe.auth.kd.C.Yu&&b(olympe.auth.Sa.F.ip,c)},'logoutHandler')}
487
+ 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.N.R={ff:'com.ConnectivityManager',Wj:'com.ServerManager',Jn:'com.BusManager',wl:'com.HttpManager',ze:'com.Serializer',Ca:'com.Logger',Tq:'com.Source',dr:'com.Urls',aB:'com.peerFileSvcUrl'};
488
+ olympe.N.U={jl:'defaultHost',zh:'server.host',Xj:'server.port',Yj:'server.ssl',Sk:'server.basePath',mr:'server.wsPath',$l:'server.reconnectionDelay',iq:'server.pingInterval',lr:'server.messageTimeout',Cq:'server.retryHttpOnOverload',al:'server.clientVersion',Qq:'server.serverVersion',bv:'server.wakeUpService',Vk:'bus.host',Kn:'bus.path',Ln:'bus.port',Qn:'bus.vhost',On:'bus.ssl',ve:'bus.keepalive',Tu:'bus.reschedulePings',Ks:'bus.clientId',Is:'bus.clean',Ns:'bus.connectTimeout',Nn:'bus.shortTimeout',
489
+ Mn:'bus.requestTimeout',Pn:'bus.subscriptionRefreshRate',Pu:'bus.queueQoSZero',Uk:'bus.allowGuest'};
490
+ olympe.W.config(function(a){var b=['localhost','127.0.0.1'];F(a,olympe.N.U.jl,'object'===typeof window&&window.location&&window.location.hostname||b[1]);var c=a.getParameter(olympe.N.U.jl);F(a,olympe.N.U.zh,c);var d=a.getParameter(olympe.N.U.zh);const e=b.includes(d);d=e||d.endsWith(a.getParameter(olympe.net.U.Dj));F(a,olympe.N.U.Xj,e?8080:d?80:443);F(a,olympe.N.U.Yj,!d);F(a,olympe.N.U.Sk,'OlympeServer');F(a,olympe.N.U.mr,'websocket');F(a,olympe.N.U.$l,5E3);F(a,olympe.N.U.iq,5E3);F(a,olympe.N.U.lr,
491
+ 3E4);F(a,olympe.N.U.Cq,4E3);F(a,olympe.N.U.Qq,'7.3.0');F(a,olympe.N.U.Vk,c);c=a.getParameter(olympe.N.U.Vk);c=(b=b.includes(c))||c.endsWith(a.getParameter(olympe.net.U.Dj));F(a,olympe.N.U.Kn,b?'':'/mqtt');F(a,olympe.N.U.Ln,b?15675:c?80:443);F(a,olympe.N.U.On,!c);F(a,olympe.N.U.Qn,b?'/':'');F(a,olympe.N.U.ve,30);F(a,olympe.N.U.Nn,5E3);F(a,olympe.N.U.Mn,3E4);F(a,olympe.N.U.Pn,6E4);F(a,olympe.N.U.Uk,!1);b=a.getParameter(olympe.dg.U.No);if(void 0!==b)Na(a,olympe.N.U.al,b);else throw Error('Framework version could not be found! Is field "olympe-framework" present in version.json?');
492
+ E(a,olympe.N.R.Ca,[olympe.ma.R.Ea],g=>g.Wc('communication'));E(a,'server.WebSocketRequest',[new olympe.W.ja(olympe.N.U.zh),new olympe.W.ja(olympe.N.U.Xj),new olympe.W.ja(olympe.N.U.Yj),new olympe.W.ja(olympe.N.U.Sk),new olympe.W.ja(olympe.N.U.mr)],(g,h,k,l,n)=>new olympe.net.Mi(g,h,(l+'/'+n).replace(/\/+/g,'/').replace(/\/$/,''),k));E(a,'server.wakeUpRequest',[new olympe.W.ja(olympe.N.U.zh),new olympe.W.ja(olympe.N.U.Xj),new olympe.W.ja(olympe.N.U.Yj),new olympe.W.ja(olympe.N.U.bv)],(g,h,k,l)=>{if(null===
493
+ l||void 0===l)return null;l=l.replace(/\/+/g,'/').replace(/\/$/,'');return new olympe.net.Mi(g,h,l,k)});const f=Array.from(Object.values(olympe.N.ac));E(a,olympe.N.R.dr,[new olympe.W.ja(olympe.N.U.zh),new olympe.W.ja(olympe.N.U.Xj),new olympe.W.ja(olympe.N.U.Yj),new olympe.W.ja(olympe.N.U.Sk),...f.map(g=>new olympe.W.ja(g))],(g,h,k,l,...n)=>{const p=f.map((q,r)=>{r=n[r];r=(new olympe.net.li(g,h,`${l}${r?'/'+r:''}`.replace(/\/+/g,'/').replace(/\/$/,''),k)).C();return[q,r]});return new Map(p)});D(a,
494
+ olympe.N.R.ze,olympe.N.fc);D(a,olympe.N.R.wl,olympe.N.pt,olympe.N.R.Ca,olympe.net.R.Ea,olympe.Y.R.Tf,olympe.N.R.dr,new olympe.W.ja(olympe.N.U.Cq));E(a,'com.server.ManagerConfig',[new olympe.W.ja(olympe.N.U.iq),new olympe.W.ja(olympe.N.U.lr),new olympe.W.ja(olympe.N.U.al),new olympe.W.ja(olympe.N.U.Qq),new olympe.W.ja(olympe.dc.U.Ah)],(...g)=>{const h=['pingInterval','messageTimeout','clientVersion','serverVersion','getContextMode'],k=new Map;g.forEach((l,n)=>k.set(h[n],l));return k});D(a,olympe.N.R.Wj,
495
+ olympe.N.Va,olympe.N.R.Ca,olympe.net.R.Ea,olympe.host.R.Qe,olympe.host.R.ak,'server.WebSocketRequest','server.wakeUpRequest',olympe.Y.R.Tf,'com.server.ManagerConfig');E(a,'com.bus.ManagerConfig',[new olympe.W.ja(olympe.N.U.zh),new olympe.W.ja(olympe.N.U.Vk),new olympe.W.ja(olympe.N.U.Kn),new olympe.W.ja(olympe.N.U.Ln),new olympe.W.ja(olympe.N.U.Qn),new olympe.W.ja(olympe.N.U.On),new olympe.W.ja(olympe.N.U.Uk),new olympe.W.ja(olympe.N.U.Nn),new olympe.W.ja(olympe.N.U.Mn),new olympe.W.ja(olympe.N.U.Pn),
496
+ new olympe.W.ja(olympe.N.U.ve),new olympe.W.ja(olympe.N.U.Tu),new olympe.W.ja(olympe.N.U.Ks),new olympe.W.ja(olympe.N.U.Is),new olympe.W.ja(olympe.N.U.$l),new olympe.W.ja(olympe.N.U.Ns),new olympe.W.ja(olympe.N.U.Pu)],(g,h,k,l,n,p,q,r,t,u,...x)=>{h=`${p?'wss://':'ws://'}${h}:${l}${k}/ws`;const y='keepalive reschedulePings clientId clean reconnectPeriod connectTimeout queueQoSZero shortTimeout requestTimeout'.split(' ');x=x.reduce((z,A,B)=>{z[y[B]]=A;return z},{});x.vhost=`${n||g.split('.')[0]}`;return new Map([['url',
497
+ h],['connectionOptions',x],['allowGuest',q],['shortTimeout',r],['requestTimeout',t],['subscriptionsRefreshRate',u]])});D(a,olympe.N.R.Jn,olympe.N.Sn,olympe.N.R.Ca,olympe.net.R.Ea,olympe.N.R.ff,olympe.auth.R.Ea,olympe.host.R.Qe,olympe.N.R.ze,olympe.Y.R.Tf,'com.bus.ManagerConfig');E(a,'com.connectivity.ManagerConfig',[olympe.net.R.Pl,olympe.Db.R.Fg,new olympe.W.ja(olympe.N.U.$l)],(g,...h)=>['storagePrefix','reconnectionDelay'].reduce((k,l,n)=>k.set(l,h[n]),g));D(a,olympe.N.R.ff,olympe.N.tc,olympe.N.R.Ca,
498
+ olympe.N.R.Wj,olympe.net.R.Ea,olympe.host.R.Qe,olympe.Db.R.Il,'com.connectivity.ManagerConfig')},'olympe.communication');olympe.W.run([olympe.N.R.Jn,olympe.N.R.ff],(a,b)=>{olympe.N.Ph=()=>a;olympe.N.Nm=()=>b});olympe.auth={};function re(a,b){Nd(a.C);Dd(a.C,olympe.N.Pe.ug,c=>{const d=c.c;d===olympe.auth.kd.C.iu?(a.C.Td(),b(olympe.auth.Sa.F.ij,c)):d===olympe.auth.kd.C.Zu&&b(olympe.auth.Sa.F.jp,c)},'logoutHandler')}
499
499
  function se(a,b,c){const d=null==b?void 0:b.mf();if(b instanceof olympe.auth.Mj){const e=g=>{const h=Object.create(null);h.url=g;h.olympe_token=b.wd();h.access_token=te(b);g=`${zd(a.nh,olympe.N.ac.Jj)}/logout${d?`?idpName=${d}`:''}`;a.F.redirect(g,h)};c=a.F.C();const f=new URL(c);0!==f.hash.length||0!==f.search.length?(f.hash='',f.search='',a.G.db.set('main',c,'redirectTo').then(()=>{e(f.toString())}).catch(g=>{a.H.error(`Error when trying to set the redirectKey in Auth store: ${g}`)})):e(c)}else Kd(a.C,
500
- olympe.N.Pe.ug,Object.assign({},{c:olympe.auth.kd.C.iu},d&&{idpName:d}),c)}function ue(a,b,c,d){olympe.D.Ma(a.J.getState())===olympe.N.rc.C.de?d(new olympe.N.errors.bq('Working offline'),'Working offline'):(c.c=b,Kd(a.C,olympe.N.Pe.ug,c,d))}
501
- function ve(a,b,c){if(b.tg()!==olympe.auth.Ec.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.mf()}&access_token=${te(b)}`;d=`${zd(a.nh,olympe.N.ac.Jj)}/refresh${d}`;Bd(a.nh,N(d),b.wd()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.Mj(b.Ac(),b.oe(),b.wd(),e,b.mf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
502
- olympe.auth.kd=class{constructor(a,b,c,d,e,f){this.H=a;this.C=b;this.nh=c;this.J=d;this.F=e;this.G=f;we(this.G).then(g=>{g&&this.G.db.remove('main','redirectTo').then(()=>{this.F.redirect(g,null,olympe.auth.Vj.C.GET)}).catch(h=>{this.H.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.H.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}cf(a){Kd(this.C,olympe.N.Pe.ug,{c:olympe.auth.kd.C.we},b=>a(b))}Ug(a,b,c){const d=zd(this.nh,olympe.N.ac.er);
503
- a=N(`${d}/${a}`);Bd(this.nh,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};olympe.auth.kd.C={ug:1,iu:2,zb:3,we:5,Di:6,rt:10,jv:11,ss:12,SAML:13,Yu:14,hu:20};function pd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.Nh());a.ka.set(c,b)}function gd(a){return olympe.D.Ma(a.C.tb())}
504
- function Td(){var a=olympe.auth.le();const b=olympe.auth.Sa.C.jj,c=olympe.auth.Sa.C.INIT;xe(a,b);a.ab?(a.G=olympe.auth.Sa.G.rs,a.H.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ye(a)):(a.G=olympe.auth.Sa.G.Fi,a.H.log('Connector online, attempting to log with token'),ze(a));return rxjs.firstValueFrom(a.F.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
505
- function Ae(a){a.H.info('Initializing AUTH layer');let b=a.hc;if(a.ea){const c=a.ea.F();b=null!=c?c:b;c&&a.ea.C().then(()=>{})}b&&a.storage&&Be(a.storage,b).catch(c=>a.H.error(c));a.H.debug('Asking to be notified when auth connector gets online');olympe.D.Nc([a.kb.getState()],c=>{switch(c){case olympe.N.rc.C.de:a.G=olympe.auth.Sa.G.Fi;a.H.log('Connector offline, attempting to recover sessions from current token');ze(a);break;case olympe.N.rc.C.$d:switch(olympe.D.Ma(a.F)){case olympe.auth.Sa.C.df:c=
506
- olympe.D.Ma(a.C).Ac();Ce(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Sa.C.hi:a.H.info('Disconnected from server - guest session lost');break;case olympe.auth.Sa.C.jj:Ce(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Sa.C.INIT:Ce(a,'Cannot open auth session - no server connection');break;default:Ce(a,'Should not get there, investigate',!0)}}});re(a.J,(c,d)=>{if(c===olympe.auth.Sa.F.ij)Ce(a,'authentication revoked'),a.storage&&De(a.storage),
507
- a.ka.forEach(e=>{e(c,d)});else if(c===olympe.auth.Sa.F.ip)a.H.info('Redirection to IDP to invalidate token (SAML)'),gd(a),a.storage&&De(a.storage),a.vb.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.Fa=Ee(a);a.T.F(()=>a.Th().catch(c=>a.H.error(`Failed to logout ${c}`)),'Logout');a.H.log('DONE initializing AUTH layer (waiting for connector to be online)')}
508
- function Fe(a,b){let c=null;olympe.D.Zi(a.F.tb().Ad(olympe.auth.Sa.C.df).and(b),()=>{const d=gd(a);!Ge(a)&&d&&(c=a.Nd.get(d.tg()).J(d,(e,f)=>{e?(a.H.error('Failed to refresh token, error message: ',e.message),a.Th().catch(g=>a.H.error(`Failed to logout after wrong refresh ${g}`))):f&&He(a,f)}))},()=>{let d;null==(d=c)||d()})}
509
- function ze(a){null!==a.storage?(a.H.debug('Retrieving token from local storage'),a.storage.ne().then(b=>{if(b){const e=new olympe.auth.Request;var c=b.Ac();e.set('username',c);c=e;var d=b.wd();c.set('nonce',d);'string'===typeof b.mf()&&e.set('idpName',b.mf());a.H.debug('Token found, trying login with',e);Ie(a,e,olympe.auth.Ec.C.Ql)}else Ce(a,'No token found, cannot perform auto login')}).catch(b=>{Ce(a,b.message,!0)})):Ce(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
510
- !0)}function Ce(a,b,c=!1){a.C.update(a.aa);xe(a,olympe.auth.Sa.C.hi);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function Ee(a){const b=[olympe.auth.Sa.C.df];a.ab||b.push(olympe.auth.Sa.C.hi);return a.T.C(()=>{const c=Je(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 xe(a,b){a.H.log('State change: ',Je(a),'--\x3e',b);a.F.update(b)}
511
- function ye(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.Ib);a.H.log('Autologin with user "'+a.Z+'"');Ie(a,b)}else Ce(a,'No user specified for auto login',!0)}function Ge(a){return olympe.D.Ma(a.C)===a.aa}function He(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Be(c,b).catch(d=>a.H.error(d));a.H.debug('Token updated')}}function Je(a){return olympe.D.Ma(a.F.tb())}function Ke(){var a=olympe.public.La.get();return new Map(a.J.C.Tc)}
512
- function Le(a,b,c,d=!1){b=b+c?':'+c.message:'';a.H.error(b);a.error.update(olympe.D.Ab(b));xe(a,olympe.auth.Sa.C.zb);if(d)throw Error(b);}function Ie(a,b,c,d){void 0===c&&(c=a.bc);void 0===c&&Le(a,'No authentication provider specified',null,!0);const e=a.Nd.get(c);e||Le(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.O.set('login',d);a.H.log('Sending authentication request using "'+c+'" for '+b);e.ne(b,a.Ub.bind(a));xe(a,olympe.auth.Sa.C.jj)}
500
+ olympe.N.Pe.ug,Object.assign({},{c:olympe.auth.kd.C.ju},d&&{idpName:d}),c)}function ue(a,b,c,d){olympe.D.Ma(a.K.getState())===olympe.N.tc.C.de?d(new olympe.N.errors.cq('Working offline'),'Working offline'):(c.c=b,Kd(a.C,olympe.N.Pe.ug,c,d))}
501
+ function ve(a,b,c){if(b.tg()!==olympe.auth.Fc.C.OAUTH2)c(Error('Only oAuth2 tokens can be refreshed'),null);else{var d=`?idpName=${b.mf()}&access_token=${te(b)}`;d=`${zd(a.nh,olympe.N.ac.Jj)}/refresh${d}`;Bd(a.nh,N(d),b.wd()).then(e=>{'string'===typeof e?(e=JSON.parse(e),e=new olympe.auth.Mj(b.Bc(),b.ne(),b.wd(),e,b.mf()),c(null,e)):c(null,b)}).catch(e=>c(Error(e),null))}}
502
+ olympe.auth.kd=class{constructor(a,b,c,d,e,f){this.H=a;this.C=b;this.nh=c;this.K=d;this.F=e;this.G=f;we(this.G).then(g=>{g&&this.G.db.remove('main','redirectTo').then(()=>{this.F.redirect(g,null,olympe.auth.Vj.C.GET)}).catch(h=>{this.H.error(`Error when trying to remove redirect key from AUTH storage: ${h}`)})}).catch(g=>{this.H.error(`Error when trying to get redirect key from AUTH storage: ${g}`)})}cf(a){Kd(this.C,olympe.N.Pe.ug,{c:olympe.auth.kd.C.ve},b=>a(b))}Ug(a,b,c){const d=zd(this.nh,olympe.N.ac.fr);
503
+ a=N(`${d}/${a}`);Bd(this.nh,a,b).then(e=>c(null,e)).catch(e=>c(Error(e)))}};olympe.auth.kd.C={ug:1,ju:2,zb:3,ve:5,Di:6,st:10,kv:11,us:12,SAML:13,Zu:14,iu:20};function pd(a,b){var c='busLogoutCallback';void 0===c&&(c=olympe.Y.Oh());a.ka.set(c,b)}function gd(a){return olympe.D.Ma(a.C.tb())}
504
+ function Td(){var a=olympe.auth.ke();const b=olympe.auth.Sa.C.jj,c=olympe.auth.Sa.C.INIT;xe(a,b);a.ab?(a.G=olympe.auth.Sa.G.ss,a.H.log('Connector online, parameter auth.autoLogin=true --\x3e attempting to log with parameters'),ye(a)):(a.G=olympe.auth.Sa.G.Fi,a.H.log('Connector online, attempting to log with token'),ze(a));return rxjs.firstValueFrom(a.F.tb().asObservable().pipe(rxjs.operators.filter(d=>!(d===b||d===c)))).catch(()=>{})}
505
+ function Ae(a){a.H.info('Initializing AUTH layer');let b=a.hc;if(a.ea){const c=a.ea.F();b=null!=c?c:b;c&&a.ea.C().then(()=>{})}b&&a.storage&&Be(a.storage,b).catch(c=>a.H.error(c));a.H.debug('Asking to be notified when auth connector gets online');olympe.D.Oc([a.kb.getState()],c=>{switch(c){case olympe.N.tc.C.de:a.G=olympe.auth.Sa.G.Fi;a.H.log('Connector offline, attempting to recover sessions from current token');ze(a);break;case olympe.N.tc.C.$d:switch(olympe.D.Ma(a.F)){case olympe.auth.Sa.C.df:c=
506
+ olympe.D.Ma(a.C).Bc();Ce(a,`Disconnected from server - session of user ${c} lost`);break;case olympe.auth.Sa.C.ii:a.H.info('Disconnected from server - guest session lost');break;case olympe.auth.Sa.C.jj:Ce(a,'Disconnected from server - authentication aborted');break;case olympe.auth.Sa.C.INIT:Ce(a,'Cannot open auth session - no server connection');break;default:Ce(a,'Should not get there, investigate',!0)}}});re(a.K,(c,d)=>{if(c===olympe.auth.Sa.F.ij)Ce(a,'authentication revoked'),a.storage&&De(a.storage),
507
+ a.ka.forEach(e=>{e(c,d)});else if(c===olympe.auth.Sa.F.jp)a.H.info('Redirection to IDP to invalidate token (SAML)'),gd(a),a.storage&&De(a.storage),a.vb.F();else throw Error(`Unknown logout step coming from server : ${c}`);});a.Fa=Ee(a);a.T.F(()=>a.Uh().catch(c=>a.H.error(`Failed to logout ${c}`)),'Logout');a.H.log('DONE initializing AUTH layer (waiting for connector to be online)')}
508
+ function Fe(a,b){let c=null;olympe.D.Zi(a.F.tb().Ad(olympe.auth.Sa.C.df).and(b),()=>{const d=gd(a);!Ge(a)&&d&&(c=a.Nd.get(d.tg()).K(d,(e,f)=>{e?(a.H.error('Failed to refresh token, error message: ',e.message),a.Uh().catch(g=>a.H.error(`Failed to logout after wrong refresh ${g}`))):f&&He(a,f)}))},()=>{let d;null==(d=c)||d()})}
509
+ function ze(a){null!==a.storage?(a.H.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.wd();c.set('nonce',d);'string'===typeof b.mf()&&e.set('idpName',b.mf());a.H.debug('Token found, trying login with',e);Ie(a,e,olympe.auth.Fc.C.Ql)}else Ce(a,'No token found, cannot perform auto login')}).catch(b=>{Ce(a,b.message,!0)})):Ce(a,'Cannot retrieve token: no storage configured, cannot perform auto login',
510
+ !0)}function Ce(a,b,c=!1){a.C.update(a.aa);xe(a,olympe.auth.Sa.C.ii);b=`Authenticated as guest (${b})`;c?a.H.error(b):a.H.info(b)}function Ee(a){const b=[olympe.auth.Sa.C.df];a.ab||b.push(olympe.auth.Sa.C.ii);return a.T.C(()=>{const c=Je(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 xe(a,b){a.H.log('State change: ',Je(a),'--\x3e',b);a.F.update(b)}
511
+ function ye(a){if(a.Z){const b=new olympe.auth.Request;b.set('username',a.Z);b.set('password',a.Ib);a.H.log('Autologin with user "'+a.Z+'"');Ie(a,b)}else Ce(a,'No user specified for auto login',!0)}function Ge(a){return olympe.D.Ma(a.C)===a.aa}function He(a,b){if(b){a.C.update(b);let c;null==(c=a.storage)||Be(c,b).catch(d=>a.H.error(d));a.H.debug('Token updated')}}function Je(a){return olympe.D.Ma(a.F.tb())}function Ke(){var a=olympe.public.La.get();return new Map(a.K.C.Uc)}
512
+ function Le(a,b,c,d=!1){b=b+c?':'+c.message:'';a.H.error(b);a.error.update(olympe.D.Ab(b));xe(a,olympe.auth.Sa.C.zb);if(d)throw Error(b);}function Ie(a,b,c,d){void 0===c&&(c=a.bc);void 0===c&&Le(a,'No authentication provider specified',null,!0);const e=a.Nd.get(c);e||Le(a,'Undefined authentication provider "'+c+'"',null,!0);d&&a.O.set('login',d);a.H.log('Sending authentication request using "'+c+'" for '+b);e.me(b,a.Vb.bind(a));xe(a,olympe.auth.Sa.C.jj)}
513
513
  function Me(a,b,c){a.O.forEach(d=>{d(b,c)})}
514
- olympe.auth.Sa=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.kb=b;this.J=c;this.storage=d;this.vb=e;this.ea=f;this.bc=l.get('defaultProvider');this.ab=!!l.get('autoLogin');this.Z=l.get('autoUser');this.Ib=l.get('autoPassword');this.hc=l.get('autoToken');this.Nd=new Map;this.T=g;this.Fa='';this.F=olympe.D.ic(String).update(olympe.auth.Sa.C.INIT);this.error=olympe.D.ic(olympe.D.Oa);this.G=null;this.aa=new olympe.auth.Jg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
515
- olympe.D.ic(olympe.auth.Jg).update(this.aa);this.O=new Map;this.ka=new Map;this.ua=new olympe.Y.Ah(l.get('cacheTokenTimeout'));k.forEach(n=>{const p=n.G();if(this.Nd.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Nd.set(p,n)});Ae(this);Fe(this,h.C())}Ck(){const a=olympe.auth.Sa.C.df,b=olympe.auth.Sa.C.hi,c=olympe.auth.Sa.C.zb,d=olympe.D.ic(olympe.D.fa);olympe.D.Nc([this.F],e=>{e===a?d.update(olympe.D.fa.F):e===b?d.update(olympe.D.fa.C):e===c?(this.H.error('Authentication failed.'),
516
- d.update(olympe.D.fa.C)):d.clear()});return d.tb()}eg(a){if(olympe.D.Ma(this.F)===olympe.auth.Sa.C.df){var b=gd(this);!Ge(this)&&b&&this.Nd.get(b.tg()).eg(b,(c,d)=>{c?(this.H.error('Failed to refresh token, error message: ',c.message),this.Th().catch(e=>this.H.error(`Failed to logout after wrong refresh ${e}`))):d&&He(this,d);a(c)})}}getState(){return this.F.tb()}Ac(){return this.C.tb().Ac()}oe(){return this.C.tb().oe()}Qh(){return this.C.tb().Qh()}Ug(a,b){if(Wa(this.ua.C,a))b(null,this.ua.get(a));
517
- else{var c,d=null==(c=olympe.D.Ma(this.C.tb()))?void 0:c.wd();this.J.Ug(a,d,(e,f)=>{'string'===typeof f&&this.ua.set(a,f);b(e,f)})}}Th(){return Ge(this)?(this.H.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.H.debug('Sending logout');De(this.storage);se(this.J,gd(this),c=>{c?(Le(this,'Logout request rejected:',c),b(c)):(this.H.debug('Logout request acknowledged'),a())});this.T.G(this.Fa)})}cf(a){Je(this)===olympe.auth.Sa.C.df&&this.J.cf(b=>{b&&
518
- this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}Ub(a,b){const c=null===this.G?olympe.auth.Sa.G.ou:this.G;this.G=null;if(!a||a instanceof olympe.N.errors.bq){null===a?this.H.info(`User ${b.Ac()} (#${b.oe()}) successfully authenticated`):this.H.info(`User ${b.Ac()} (#${b.oe()}) recovered from token, while offline`);this.C.update(b);xe(this,olympe.auth.Sa.C.df);Me(this,a,c);let d;null==(d=this.storage)||Be(d,b).catch(e=>this.H.error(e))}else{let d;null==(d=
519
- this.storage)||De(d).catch(e=>this.H.error(e));this.error.update(olympe.D.Ab(a.message));Ce(this,'authentication rejected: '+a.message);Me(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Sa.C={INIT:'init',jj:'authenticating',hi:'guest',df:'authenticated',zb:'error'};olympe.auth.Sa.G={ou:'manual',rs:'auto',Fi:'tokenOnFirstConnection'};olympe.auth.Sa.F={ij:'accepted',ip:'redirect'};olympe.auth.Ec=class{constructor(a,b){this.H=a;this.F=b;this.C=null}G(){}ne(){}J(a,b){const c=()=>{this.C=setTimeout(()=>this.F.cf(d=>{d?b(d,null):(b(null,null),c())}),this.F.C.Bc)};c();return()=>{this.C&&clearTimeout(this.C);this.C=null}}eg(a,b){this.F.cf(c=>{b(c,null)})}};olympe.auth.Ec.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',Ql:'olympeToken'};function Ne(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Nc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Kg&&(a=a.Da.Eb);return a?a.valueOf():a}Ac(){return this.get('username')}wd(){return this.get('nonce')}toString(){return this.Ac()+(this.wd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ne(this)?` with idp name ${Ne(this)}`:'')}};olympe.auth.Jg=class{constructor(a,b,c,d={},e=null){this.J=a;this.Wh=b;this.F=c;this.C=e;this.G=d}Ac(){return this.J}oe(){return this.Wh}wd(){return this.F}ni(){return this.G}Qh(){return null}mf(){return this.C}ha(){const a=olympe.Y.Ye(),b=Object.assign({},{user:this.J,userTag:this.Wh,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.vr(Ta(a,JSON.stringify(b)))}tg(){return olympe.auth.Ec.C.SRP}};m=olympe.auth.Jg.prototype;m.Ac.L=new olympe.D.K(()=>String,[]);
520
- m.oe.L=new olympe.D.K(()=>String,[]);m.wd.L=new olympe.D.K(()=>String,[]);m.ni.L=new olympe.D.K(()=>Object,[]);m.Qh.L=new olympe.D.K(()=>String,[]);m.mf.L=new olympe.D.K(()=>String,[]);m.ha.L=new olympe.D.K(()=>String,[]);m.tg.L=new olympe.D.K(()=>String,[]);function te(a){return a.ni().access_token||null}function Oe(a){return 1E3*parseInt(a.ni().access_token_exp||'0',10)}olympe.auth.Mj=class extends olympe.auth.Jg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.O=Date.now()}Qh(){return te(this)}tg(){return olympe.auth.Ec.C.OAUTH2}};olympe.auth.Kq=class extends olympe.auth.Jg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.O=d}Qh(){return this.O}tg(){return olympe.auth.Ec.C.SAML}ha(){const a=olympe.Y.Ye(),b=Object.assign({},{user:this.Ac(),userTag:this.oe(),nonce:this.wd()},this.mf()&&{idpName:this.mf()},{payload:this.ni(),fullToken:this.O});return olympe.Y.vr(Ta(a,JSON.stringify(b)))}};function we(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Be(a,b){return gb(a.F,()=>a.db.set('main','string'===typeof b?b:b.ha(),a.C).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function De(a){return gb(a.F,()=>a.db.remove('main',a.C).catch(b=>{a.H.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
521
- olympe.auth.zs=class{constructor(a,b,c){this.G=a;this.H=b;this.C='OlympeToken-'+c.C;this.F=new olympe.Y.promise.im;this.db=this.G.F('AUTH')}ne(){this.H.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.C}`);return gb(this.F,()=>{const a=this;return v(function*(){let b;try{b=yield a.db.get('main',a.C)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.H.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
522
- d.parse;var f=Ua(olympe.Y.Ye().F(olympe.Y.Yv(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Kq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.Mj(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Jg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.H.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.Vj=class{redirect(){}F(){}C(){}};olympe.auth.Vj.C={GET:'GET',th:'POST'};olympe.auth.Bn=class{constructor(a){this.C=a||'default'}};olympe.auth.Nd={};function Pe(a,b,c){ue(a.F,olympe.auth.kd.C.ug,{token:b.wd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.kd.C.zb:c(Error('Invalid token'),null);break;case olympe.auth.kd.C.Di: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.Kq(f,g,h,e.samlToken,k,Ne(b)):'openid'===l&&(d=new olympe.auth.Mj(f,g,h,k,Ne(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
523
- olympe.auth.Nd.nu=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.storage=c}G(){return olympe.auth.Ec.C.Ql}ne(a,b){this.storage.ne().then(c=>{Pe(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function Qe(a,b,c){var d=Oe(b);const e=Math.max(d-b.O,0),f=olympe.W.getParameter(olympe.auth.U.ar);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.eg(b,c)},d);a.eg(b,c);return null}
524
- olympe.auth.Nd.Du=class extends olympe.auth.Ec{constructor(a,b,c,d){super(a,b);this.O=c;this.T=d}G(){return olympe.auth.Ec.C.OAUTH2}ne(a){const b=encodeURIComponent(this.O.C());a=Ne(a)?`idpName=${Ne(a)}&`:'';this.O.redirect(`${this.T}/auth?${a}url=${b}`,null,olympe.auth.Vj.C.GET)}J(a,b){0<Oe(a)?this.C=Qe(this,a,b):b(null,a);return this.Z.bind(this)}eg(a,b){ve(this.F,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.C&&(this.C=Qe(this,d,b)))})}Z(){this.C&&clearTimeout(this.C);this.C=null}};function Re(a,b){ue(a.F,olympe.auth.kd.C.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Nd.SAML=class extends olympe.auth.Ec{constructor(a,b,c){super(a,b);this.O=c}G(){return olympe.auth.Ec.C.SAML}ne(a,b){Re(this,c=>{c?b(c,null):this.O.F(Ne(a))})}};function Se(a,b,c){const d=olympe.auth.kd.C.rt,e=olympe.auth.kd.C.zb,f=olympe.auth.kd.C.jv,g={I:b.Ac()};ue(a.F,d,g,(h,k)=>{if(null!==h)c(h);else switch(k.c){case e:c(Error(`Username '${b.Ac()}' 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'))}})}
525
- function Te(a,b,c){const d=olympe.auth.kd.C.ss,e=olympe.auth.kd.C.zb,f=olympe.auth.kd.C.Di;b={A:b.get('a'),M:b.get('m1'),I:b.Ac()};ue(a.F,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.H.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.H.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Jg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
526
- null)}})}olympe.auth.Nd.SRP=class extends olympe.auth.Ec{G(){return olympe.auth.Ec.C.SRP}ne(a,b){const c=a.get('password');a.C.delete('password');this.H.debug('Sending SRP request');Se(this,a,(d,e,f)=>{this.H.debug('Received Salt+B message');if(d)b(d,null);else{try{const g=new SRPClient;g.step1(a.Ac(),c);const h=g.step2(e,f);a.set('a',h.A);a.set('m1',h.M1)}catch(g){b(g,null);return}this.H.debug('Sending SRP A+M (proof) message');Te(this,a,b)}})}};olympe.auth.R={Ea:'auth.Manager',Ca:'auth.Logger',Ci:'auth.Storage',Nk:'auth.appNameToken',Sj:'auth.Redirector',Nq:'auth.ServerConnector'};olympe.auth.U={kl:'auth.defaultProvider',vn:'auth.autoLogin',xn:'auth.autoUser',wn:'auth.autoPassword',Fi:'auth.token',Un:'auth.cacheTokenTimeout',ar:'auth.tokenDurationPercentage'};
527
- olympe.W.config(function(a){F(a,olympe.auth.U.kl,olympe.auth.Ec.C.SRP);F(a,olympe.auth.U.vn,!1);F(a,olympe.auth.U.xn,'');F(a,olympe.auth.U.wn,'');F(a,olympe.auth.U.Fi,'');F(a,olympe.auth.U.ar,50);F(a,olympe.auth.U.Un,3E5);E(a,olympe.auth.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('auth'));D(a,olympe.auth.R.Nk,olympe.auth.Bn,olympe.Db.R.Fg);D(a,olympe.auth.R.Ci,olympe.auth.zs,olympe.Db.R.Cj,olympe.auth.R.Ca,olympe.auth.R.Nk);D(a,olympe.auth.R.Nq,olympe.auth.kd,olympe.auth.R.Ca,olympe.N.R.Wj,olympe.N.R.wl,olympe.N.R.ff,
528
- olympe.auth.R.Sj,olympe.auth.R.Ci);Ma(a,olympe.auth.R.Sj);E(a,olympe.auth.R.Ea,[olympe.auth.R.Ca,olympe.N.R.ff,olympe.auth.R.Nq,olympe.host.R.tl,olympe.host.R.Qe,olympe.host.R.ak,new olympe.W.yb(olympe.auth.R.Ci,olympe.W.eh.C.Nl),new olympe.W.yb(olympe.auth.R.Sj,olympe.W.eh.C.Nl),new olympe.W.ja(olympe.auth.U.kl),new olympe.W.ja(olympe.auth.U.vn),new olympe.W.ja(olympe.auth.U.xn),new olympe.W.ja(olympe.auth.U.wn),new olympe.W.ja(olympe.auth.U.Fi),new olympe.W.ja(olympe.auth.U.Un)],(b,c,d,e,f,g,h,
529
- k,l,n,p,q,r,t)=>{const u=[new olympe.auth.Nd.nu(b,d,h),new olympe.auth.Nd.SRP(b,d),new olympe.auth.Nd.SAML(b,d,k),new olympe.auth.Nd.Du(b,d,k,zd(d.nh,olympe.N.ac.Jj))];if(!u.map(x=>x.G()).includes(l))throw Error(`Default provider name ${l} given by parameter ${olympe.auth.U.kl} cannot be found`);return new olympe.auth.Sa(b,c,d,h,k,e.$i()?e:null,f,g,u,new Map([['defaultProvider',l],['autoLogin',n],['autoUser',p],['autoPassword',q],['autoToken',r],['cacheTokenTimeout',t]]))},!0)},'olympe.auth');
530
- olympe.W.run([olympe.auth.R.Ea],a=>{olympe.auth.le=()=>a});olympe.Ta.node.auth={};olympe.Ta.node.auth.Tp=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Ta.node.auth.Tp.ya=[olympe.auth.Vj];olympe.W.config(a=>{D(a,olympe.auth.R.Sj,olympe.Ta.node.auth.Tp)},'olympe.native.node.auth');olympe.Ta.node.Db={};function Ue(){throw Error('Key-Value Database does not implement this in NodeJS');}
531
- olympe.Ta.node.Db.Rp=class{constructor(a){this.H=a;this.C=new Map}Z(){return 0}O(a){const b=this;return v(function*(){let c,d;return null!=(d=null==(c=b.C.get(a))?void 0:c.size)?d:0})}G(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.values()):[]})}T(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return v(function*(){let d;for(const [e,f]of null!=(d=c.C.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
514
+ olympe.auth.Sa=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.kb=b;this.K=c;this.storage=d;this.vb=e;this.ea=f;this.bc=l.get('defaultProvider');this.ab=!!l.get('autoLogin');this.Z=l.get('autoUser');this.Ib=l.get('autoPassword');this.hc=l.get('autoToken');this.Nd=new Map;this.T=g;this.Fa='';this.F=olympe.D.ic(String).update(olympe.auth.Sa.C.INIT);this.error=olympe.D.ic(olympe.D.Oa);this.G=null;this.aa=new olympe.auth.Jg('guest','0163d9653067b6237f62','e96e099c-55bb-4004-b0e8-bd76b6209218');this.C=
515
+ olympe.D.ic(olympe.auth.Jg).update(this.aa);this.O=new Map;this.ka=new Map;this.ua=new olympe.Y.Bh(l.get('cacheTokenTimeout'));k.forEach(n=>{const p=n.G();if(this.Nd.has(p))throw Error('Provider "'+p+'" has already been registered !');this.Nd.set(p,n)});Ae(this);Fe(this,h.C())}Ck(){const a=olympe.auth.Sa.C.df,b=olympe.auth.Sa.C.ii,c=olympe.auth.Sa.C.zb,d=olympe.D.ic(olympe.D.fa);olympe.D.Oc([this.F],e=>{e===a?d.update(olympe.D.fa.F):e===b?d.update(olympe.D.fa.C):e===c?(this.H.error('Authentication failed.'),
516
+ d.update(olympe.D.fa.C)):d.clear()});return d.tb()}eg(a){if(olympe.D.Ma(this.F)===olympe.auth.Sa.C.df){var b=gd(this);!Ge(this)&&b&&this.Nd.get(b.tg()).eg(b,(c,d)=>{c?(this.H.error('Failed to refresh token, error message: ',c.message),this.Uh().catch(e=>this.H.error(`Failed to logout after wrong refresh ${e}`))):d&&He(this,d);a(c)})}}getState(){return this.F.tb()}Bc(){return this.C.tb().Bc()}ne(){return this.C.tb().ne()}Rh(){return this.C.tb().Rh()}Ug(a,b){if(Wa(this.ua.C,a))b(null,this.ua.get(a));
517
+ else{var c,d=null==(c=olympe.D.Ma(this.C.tb()))?void 0:c.wd();this.K.Ug(a,d,(e,f)=>{'string'===typeof f&&this.ua.set(a,f);b(e,f)})}}Uh(){return Ge(this)?(this.H.warn('Logout called for Guest user so it will be ignored'),Promise.resolve()):new Promise((a,b)=>{this.H.debug('Sending logout');De(this.storage);se(this.K,gd(this),c=>{c?(Le(this,'Logout request rejected:',c),b(c)):(this.H.debug('Logout request acknowledged'),a())});this.T.G(this.Fa)})}cf(a){Je(this)===olympe.auth.Sa.C.df&&this.K.cf(b=>{b&&
518
+ this.H.error('Was not able to send the auth keep alive message:',b.message);null==a||a(b)})}Vb(a,b){const c=null===this.G?olympe.auth.Sa.G.pu:this.G;this.G=null;if(!a||a instanceof olympe.N.errors.cq){null===a?this.H.info(`User ${b.Bc()} (#${b.ne()}) successfully authenticated`):this.H.info(`User ${b.Bc()} (#${b.ne()}) recovered from token, while offline`);this.C.update(b);xe(this,olympe.auth.Sa.C.df);Me(this,a,c);let d;null==(d=this.storage)||Be(d,b).catch(e=>this.H.error(e))}else{let d;null==(d=
519
+ this.storage)||De(d).catch(e=>this.H.error(e));this.error.update(olympe.D.Ab(a.message));Ce(this,'authentication rejected: '+a.message);Me(this,a,c)}this.O.has('login')&&this.O.delete('login')}};olympe.auth.Sa.C={INIT:'init',jj:'authenticating',ii:'guest',df:'authenticated',zb:'error'};olympe.auth.Sa.G={pu:'manual',ss:'auto',Fi:'tokenOnFirstConnection'};olympe.auth.Sa.F={ij:'accepted',jp:'redirect'};olympe.auth.Fc=class{constructor(a,b){this.H=a;this.F=b;this.C=null}G(){}me(){}K(a,b){const c=()=>{this.C=setTimeout(()=>this.F.cf(d=>{d?b(d,null):(b(null,null),c())}),this.F.C.Cc)};c();return()=>{this.C&&clearTimeout(this.C);this.C=null}}eg(a,b){this.F.cf(c=>{b(c,null)})}};olympe.auth.Fc.C={SAML:'saml',OAUTH2:'openID',SRP:'srp',Ql:'olympeToken'};function Ne(a){return a.get('idpName')}olympe.auth.Request=class{constructor(){this.C=new Map}set(a,b){olympe.D.Oc([b],c=>{this.C.set(a.toLocaleLowerCase(),c.toString())})}get(a){(a=this.C.get(a.toLowerCase()))&&a.Kg&&(a=a.Da.Eb);return a?a.valueOf():a}Bc(){return this.get('username')}wd(){return this.get('nonce')}toString(){return this.Bc()+(this.wd()?' with nonce':'')+(this.get('password')?' with password':'')+(Ne(this)?` with idp name ${Ne(this)}`:'')}};olympe.auth.Jg=class{constructor(a,b,c,d={},e=null){this.K=a;this.Xh=b;this.F=c;this.C=e;this.G=d}Bc(){return this.K}ne(){return this.Xh}wd(){return this.F}oi(){return this.G}Rh(){return null}mf(){return this.C}ha(){const a=olympe.Y.Ye(),b=Object.assign({},{user:this.K,userTag:this.Xh,nonce:this.F},this.C&&{idpName:this.C},{payload:this.G});return olympe.Y.wr(Ta(a,JSON.stringify(b)))}tg(){return olympe.auth.Fc.C.SRP}};m=olympe.auth.Jg.prototype;m.Bc.L=new olympe.D.J(()=>String,[]);
520
+ m.ne.L=new olympe.D.J(()=>String,[]);m.wd.L=new olympe.D.J(()=>String,[]);m.oi.L=new olympe.D.J(()=>Object,[]);m.Rh.L=new olympe.D.J(()=>String,[]);m.mf.L=new olympe.D.J(()=>String,[]);m.ha.L=new olympe.D.J(()=>String,[]);m.tg.L=new olympe.D.J(()=>String,[]);function te(a){return a.oi().access_token||null}function Oe(a){return 1E3*parseInt(a.oi().access_token_exp||'0',10)}olympe.auth.Mj=class extends olympe.auth.Jg{constructor(a,b,c,d,e){super(a,b,c,d,e);this.O=Date.now()}Rh(){return te(this)}tg(){return olympe.auth.Fc.C.OAUTH2}};olympe.auth.Lq=class extends olympe.auth.Jg{constructor(a,b,c,d,e,f){super(a,b,c,e,f);this.O=d}Rh(){return this.O}tg(){return olympe.auth.Fc.C.SAML}ha(){const a=olympe.Y.Ye(),b=Object.assign({},{user:this.Bc(),userTag:this.ne(),nonce:this.wd()},this.mf()&&{idpName:this.mf()},{payload:this.oi(),fullToken:this.O});return olympe.Y.wr(Ta(a,JSON.stringify(b)))}};function we(a){let b;return null!=(b=a.db.get('main','redirectTo'))?b:null}function Be(a,b){return gb(a.F,()=>a.db.set('main','string'===typeof b?b:b.ha(),a.C).catch(c=>{throw Error(`Error when trying to set the token from the auth store: ${c}`);}))}function De(a){return gb(a.F,()=>a.db.remove('main',a.C).catch(b=>{a.H.error(`Error when trying to remove the token from the auth store: ${b}`)}))}
521
+ olympe.auth.As=class{constructor(a,b,c){this.G=a;this.H=b;this.C='OlympeToken-'+c.C;this.F=new olympe.Y.promise.im;this.db=this.G.F('AUTH')}me(){this.H.debug(`olympe.auth.AuthStorage: retrieve token with key ${this.C}`);return gb(this.F,()=>{const a=this;return v(function*(){let b;try{b=yield a.db.get('main',a.C)}catch(g){throw Error(`Error when trying to get the token from the auth store: ${g}`);}let c=null;if(b)try{a.H.debug('olympe.auth.AuthStorage: Token retrieved successfully');var d=JSON,e=
522
+ d.parse;var f=Ua(olympe.Y.Ye().F(olympe.Y.Zv(b)));const g=e.call(d,f);let h;g.fullToken?h=new olympe.auth.Lq(g.user,g.userTag,g.nonce,g.fullToken,g.payload,g.idpName):g.payload&&g.payload.id_token?h=new olympe.auth.Mj(g.user,g.userTag,g.nonce,g.payload,g.idpName):h=new olympe.auth.Jg(g.user,g.userTag,g.nonce,g.payload,g.idpName);c=h}catch(g){throw Error(`Error while unserializing token: ${g}`);}else a.H.debug('olympe.auth.AuthStorage: No token found');return c})})}};olympe.auth.Vj=class{redirect(){}F(){}C(){}};olympe.auth.Vj.C={GET:'GET',uh:'POST'};olympe.auth.Bn=class{constructor(a){this.C=a||'default'}};olympe.auth.Nd={};function Pe(a,b,c){ue(a.F,olympe.auth.kd.C.ug,{token:b.wd()},(d,e)=>{if(null!==d)c(d,null);else switch(e.c){case olympe.auth.kd.C.zb:c(Error('Invalid token'),null);break;case olympe.auth.kd.C.Di: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.Lq(f,g,h,e.samlToken,k,Ne(b)):'openid'===l&&(d=new olympe.auth.Mj(f,g,h,k,Ne(b)))}c(null,d);break;default:c(Error('Unknown response from server'),null)}})}
523
+ olympe.auth.Nd.ou=class extends olympe.auth.Fc{constructor(a,b,c){super(a,b);this.storage=c}G(){return olympe.auth.Fc.C.Ql}me(a,b){this.storage.me().then(c=>{Pe(this,a,(d,e)=>{b(d,null!=e?e:c)})}).catch(c=>{b(c,null)})}};function Qe(a,b,c){var d=Oe(b);const e=Math.max(d-b.O,0),f=olympe.W.getParameter(olympe.auth.U.br);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.eg(b,c)},d);a.eg(b,c);return null}
524
+ olympe.auth.Nd.Eu=class extends olympe.auth.Fc{constructor(a,b,c,d){super(a,b);this.O=c;this.T=d}G(){return olympe.auth.Fc.C.OAUTH2}me(a){const b=encodeURIComponent(this.O.C());a=Ne(a)?`idpName=${Ne(a)}&`:'';this.O.redirect(`${this.T}/auth?${a}url=${b}`,null,olympe.auth.Vj.C.GET)}K(a,b){0<Oe(a)?this.C=Qe(this,a,b):b(null,a);return this.Z.bind(this)}eg(a,b){ve(this.F,a,(c,d)=>{c?b(c,null):d&&(b(null,d),this.C&&(this.C=Qe(this,d,b)))})}Z(){this.C&&clearTimeout(this.C);this.C=null}};function Re(a,b){ue(a.F,olympe.auth.kd.C.SAML,{},(c,d)=>{null!==c?b(c):d.url&&d.request?b(null,d.url,d.request.replace(/\s/g,''),d.id):b(Error('Missing parameters from server response'))})}olympe.auth.Nd.SAML=class extends olympe.auth.Fc{constructor(a,b,c){super(a,b);this.O=c}G(){return olympe.auth.Fc.C.SAML}me(a,b){Re(this,c=>{c?b(c,null):this.O.F(Ne(a))})}};function Se(a,b,c){const d=olympe.auth.kd.C.st,e=olympe.auth.kd.C.zb,f=olympe.auth.kd.C.kv,g={I:b.Bc()};ue(a.F,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'))}})}
525
+ function Te(a,b,c){const d=olympe.auth.kd.C.us,e=olympe.auth.kd.C.zb,f=olympe.auth.kd.C.Di;b={A:b.get('a'),M:b.get('m1'),I:b.Bc()};ue(a.F,d,b,(g,h)=>{if(null!==g)c(g,null);else switch(h.c){case e:a.H.debug('Login failed, invalid username or password');c(Error('Invalid username or password'),null);break;case f:g=h.payload;a.H.debug('Login successful, creating token');h=g.payload?JSON.parse(g.payload):void 0;c(null,new olympe.auth.Jg(g.userName,g.userTag,g.rndCook,h));break;default:c(Error(`Unknown response from server (type ${h.c})`),
526
+ null)}})}olympe.auth.Nd.SRP=class extends olympe.auth.Fc{G(){return olympe.auth.Fc.C.SRP}me(a,b){const c=a.get('password');a.C.delete('password');this.H.debug('Sending SRP request');Se(this,a,(d,e,f)=>{this.H.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.H.debug('Sending SRP A+M (proof) message');Te(this,a,b)}})}};olympe.auth.R={Ea:'auth.Manager',Ca:'auth.Logger',Ci:'auth.Storage',Nk:'auth.appNameToken',Sj:'auth.Redirector',Oq:'auth.ServerConnector'};olympe.auth.U={kl:'auth.defaultProvider',vn:'auth.autoLogin',xn:'auth.autoUser',wn:'auth.autoPassword',Fi:'auth.token',Un:'auth.cacheTokenTimeout',br:'auth.tokenDurationPercentage'};
527
+ olympe.W.config(function(a){F(a,olympe.auth.U.kl,olympe.auth.Fc.C.SRP);F(a,olympe.auth.U.vn,!1);F(a,olympe.auth.U.xn,'');F(a,olympe.auth.U.wn,'');F(a,olympe.auth.U.Fi,'');F(a,olympe.auth.U.br,50);F(a,olympe.auth.U.Un,3E5);E(a,olympe.auth.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('auth'));D(a,olympe.auth.R.Nk,olympe.auth.Bn,olympe.Db.R.Fg);D(a,olympe.auth.R.Ci,olympe.auth.As,olympe.Db.R.Cj,olympe.auth.R.Ca,olympe.auth.R.Nk);D(a,olympe.auth.R.Oq,olympe.auth.kd,olympe.auth.R.Ca,olympe.N.R.Wj,olympe.N.R.wl,olympe.N.R.ff,
528
+ olympe.auth.R.Sj,olympe.auth.R.Ci);Ma(a,olympe.auth.R.Sj);E(a,olympe.auth.R.Ea,[olympe.auth.R.Ca,olympe.N.R.ff,olympe.auth.R.Oq,olympe.host.R.tl,olympe.host.R.Qe,olympe.host.R.ak,new olympe.W.yb(olympe.auth.R.Ci,olympe.W.eh.C.Nl),new olympe.W.yb(olympe.auth.R.Sj,olympe.W.eh.C.Nl),new olympe.W.ja(olympe.auth.U.kl),new olympe.W.ja(olympe.auth.U.vn),new olympe.W.ja(olympe.auth.U.xn),new olympe.W.ja(olympe.auth.U.wn),new olympe.W.ja(olympe.auth.U.Fi),new olympe.W.ja(olympe.auth.U.Un)],(b,c,d,e,f,g,h,
529
+ k,l,n,p,q,r,t)=>{const u=[new olympe.auth.Nd.ou(b,d,h),new olympe.auth.Nd.SRP(b,d),new olympe.auth.Nd.SAML(b,d,k),new olympe.auth.Nd.Eu(b,d,k,zd(d.nh,olympe.N.ac.Jj))];if(!u.map(x=>x.G()).includes(l))throw Error(`Default provider name ${l} given by parameter ${olympe.auth.U.kl} cannot be found`);return new olympe.auth.Sa(b,c,d,h,k,e.$i()?e:null,f,g,u,new Map([['defaultProvider',l],['autoLogin',n],['autoUser',p],['autoPassword',q],['autoToken',r],['cacheTokenTimeout',t]]))},!0)},'olympe.auth');
530
+ olympe.W.run([olympe.auth.R.Ea],a=>{olympe.auth.ke=()=>a});olympe.Ta.node.auth={};olympe.Ta.node.auth.Up=class{redirect(){console.warn('Redirection n/a in Node.JS')}F(){console.warn('Redirection n/a in Node.JS')}C(){console.warn('Redirection n/a in Node.JS');return''}};olympe.Ta.node.auth.Up.ya=[olympe.auth.Vj];olympe.W.config(a=>{D(a,olympe.auth.R.Sj,olympe.Ta.node.auth.Up)},'olympe.native.node.auth');olympe.Ta.node.Db={};function Ue(){throw Error('Key-Value Database does not implement this in NodeJS');}
531
+ olympe.Ta.node.Db.Sp=class{constructor(a){this.H=a;this.C=new Map}Z(){return 0}O(a){const b=this;return v(function*(){let c,d;return null!=(d=null==(c=b.C.get(a))?void 0:c.size)?d:0})}G(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.values()):[]})}T(a){const b=this;return v(function*(){const c=b.C.get(a);return c?Array.from(c.keys()):[]})}forEach(a,b){const c=this;return v(function*(){let d;for(const [e,f]of null!=(d=c.C.get(a))?d:new Map)b(f,e)})}has(a,b){const c=this;
532
532
  return v(function*(){let d,e;return null!=(e=null==(d=c.C.get(a))?void 0:d.has(b))?e:!1})}get(a,b){const c=this;return v(function*(){let d;return null==(d=c.C.get(a))?void 0:d.get(b)})}set(a,b,c){const d=this;return v(function*(){let e;return null==(e=d.C.get(a))?void 0:e.set(c,b)})}remove(a,b){const c=this;return v(function*(){let d;yield null==(d=c.C.get(a))?void 0:d.delete(b)})}ea(){Ue();return Promise.resolve()}aa(){Ue();return Promise.resolve()}clear(a){const b=this;return v(function*(){let c;
533
- null==(c=b.C.get(a))||c.clear()})}J(){Ue();return Promise.resolve([])}F(){return v(function*(){Ue()})}};olympe.Ta.node.Db.Rp.ya=[olympe.Db.cu];olympe.Ta.node.Db.Sp=class{constructor(a){this.C=new Map;this.H=a}F(a){this.C.has(a)||this.C.set(a,new olympe.Ta.node.Db.Rp(this.H));return this.C.get(a)}};olympe.Ta.node.Db.Sp.ya=[olympe.Db.du];olympe.W.config(function(a){D(a,olympe.Db.R.Cj,olympe.Ta.node.Db.Sp,olympe.Db.R.Ca)},'olympe.native.node.localstorage');olympe.Ta.node.storage={};olympe.Ta.node.storage.Storage=class{constructor(a){this.H=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Ta.node.storage.Storage.ya=[olympe.Db.Storage];olympe.W.config(function(a){Ka(a,olympe.Db.R.Ci,olympe.Ta.node.storage.Storage,olympe.host.R.Ca)},'olympe.native.html.storage');olympe.dg={};olympe.dg.U={VERSION:'version.version',Ds:'version.branch',ef:'version.commit',qv:'version.tag',No:'version.olympe-framework',Es:'version.build'};olympe.W.config(function(a){F(a,olympe.dg.U.VERSION,'');F(a,olympe.dg.U.Ds,'');F(a,olympe.dg.U.ef,'');F(a,olympe.dg.U.qv,'');F(a,olympe.dg.U.No,'');F(a,olympe.dg.U.Es,'')},'olympe.main');const Ve=require('fs');let Qa,Oa;function We(a,b){Ve.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
533
+ null==(c=b.C.get(a))||c.clear()})}K(){Ue();return Promise.resolve([])}F(){return v(function*(){Ue()})}};olympe.Ta.node.Db.Sp.ya=[olympe.Db.du];olympe.Ta.node.Db.Tp=class{constructor(a){this.C=new Map;this.H=a}F(a){this.C.has(a)||this.C.set(a,new olympe.Ta.node.Db.Sp(this.H));return this.C.get(a)}};olympe.Ta.node.Db.Tp.ya=[olympe.Db.eu];olympe.W.config(function(a){D(a,olympe.Db.R.Cj,olympe.Ta.node.Db.Tp,olympe.Db.R.Ca)},'olympe.native.node.localstorage');olympe.Ta.node.storage={};olympe.Ta.node.storage.Storage=class{constructor(a){this.H=a}write(a,b,c,d,e){e&&e('Not Implemented.')}open(a){a(null)}close(a){a(null)}};olympe.Ta.node.storage.Storage.ya=[olympe.Db.Storage];olympe.W.config(function(a){Ka(a,olympe.Db.R.Ci,olympe.Ta.node.storage.Storage,olympe.host.R.Ca)},'olympe.native.html.storage');olympe.dg={};olympe.dg.U={VERSION:'version.version',Es:'version.branch',ef:'version.commit',rv:'version.tag',No:'version.olympe-framework',Fs:'version.build'};olympe.W.config(function(a){F(a,olympe.dg.U.VERSION,'');F(a,olympe.dg.U.Es,'');F(a,olympe.dg.U.ef,'');F(a,olympe.dg.U.rv,'');F(a,olympe.dg.U.No,'');F(a,olympe.dg.U.Fs,'')},'olympe.main');const Ve=require('fs');let Qa,Oa;function We(a,b){Ve.readFile(a,(c,d)=>{c?b(Object.create(null)):(d=JSON.parse(d),b(d))})}
534
534
  function Xe(){if(void 0!==Qa&&void 0!==Oa){0===Object.keys(Oa).length&&console.warn('No configuration found. Check presence of oConfig.json');0===Object.keys(Qa).length&&console.warn('No version found. Check presence of version.json');var a=Object.create(null);const b=process.argv;for(let c=2;c<b.length;c++){const d=/^true|false$/i,e=/^\d+(\.\d+)?$/;let f;const g=/([^?&=]+)(=?([^?&=]+))?/g.exec(b[c]);!Array.isArray(g)||4>g.length?console.warn(`Malformed config parameter "${b[c]}" ignored. It should of the form 'a=b'`):
535
- (f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.W.Ss(a);Da(a);Fa(a.compile())}}function Ye(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Ta.node.host).vk)||Cc(b.call(a)).then(()=>console.log('The node backend has stopped successfully')).catch(c=>console.warn(c)).finally(()=>process.exit(0))}
536
- olympe.Y.Fe('oConfig.json',We,function(a){Oa=a;Xe()});We('version.json',function(a){Qa=a;Xe()});process.on('SIGTERM',Ye);process.on('SIGINT',Ye);process.on('SIGBREAK',Ye);process.on('SIGHUP',Ye);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Ye()});olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.wa);olympe.dc.nc={Zc:'ff022000000000000000',ei:'ff02200000000000000e',pj:'ff02200000000000000f'};olympe.dc.sp={VERSION:'@v',Sq:'@s'};olympe.dc.Oe={Me:'?',lh:'~'};olympe.dc.MB={yi:'online',de:'offline',tA:'invalidate'};olympe.dc.Qa={SELF:'self',SERVER:'server',qf:'remote',de:'offline'};
537
- olympe.dc.Ob={NONE:null,vo:'ff023000000000000037',Cc:'ff023000000000000137',Uf:'ff023000000000000237',fv:'ff023000000000000337',Zs:'ff023000000000000437',vA:olympe.dc.Oe.lh+'ff023000000000000037',wA:olympe.dc.Oe.lh+'ff023000000000000237',uA:olympe.dc.Oe.lh+'ff023000000000000437'};olympe.dc.$p=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.Xd(),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.Writable=class{Vc(){}Qc(){}F(){}Ha(){}jc(){}};olympe.dc.Ju=class{Uc(){}V(){}O(){}};olympe.dc.Fc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ga(a){return a instanceof olympe.dc.Fc&&this.tag===a.tag}};olympe.dc.Fc.ya=[olympe.dc.Ne];olympe.dc.Fc.prototype.Ga.L=olympe.D.K.C;olympe.dc.it=class a{constructor(b,c,d,e,f,g){this.H=b;this.Z=c;this.db=c.view;this.aa=d;this.Yb=e;this.F=f;this.O=g;this.C=new Map;this.G=Ya(new olympe.Y.Ah(6E5),(h,k)=>{URL.revokeObjectURL(k);Ze(this.db,h,a.C(h))})}ea(b,c,d,e,f){this.Fa(c).then(g=>{this.ab(b,g,d,!!this.O,e,f)}).catch(g=>this.H.error(g))}J(b){const c=this;return v(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.H.error(f);throw Error(f);},e=b.X();if(Wa(c.G.C,e)){const f=c.G.get(e);return c.F.G(f).then(g=>g.arrayBuffer()).then(g=>
538
- new Uint8Array(g)).catch(d)}return c.downloadFileContent(b).then(f=>c.F.J(f)).then(f=>{if(c.O){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.T(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.X(),d=b.get(olympe.dm.File.C);const e=b.get(olympe.dm.File.urlProp);return e.startsWith('stream:')?this.ka(c).then(()=>this.downloadFileContent(b)):e.startsWith('blob:')?this.F.G(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f)):d?(d=this.db.model(b),
539
- c=new olympe.dc.Request(olympe.dc.Request.C.Of,olympe.dc.Xd().Ee(b),{tag:c,model:d,url:e.valueOf()}),this.Yb.request(c)):new Promise((f,g)=>{const h=N(e);h.F=olympe.net.Ba.ResponseType.Tk;this.aa.C(h,k=>{const l=k.Hc();200<=l&&300>l?f(k.getData()):g(`Failed to download file ${b}. Response code ${l}`)})})}ua(b){const c=new olympe.Y.stream.Bg;this.J(b).then(d=>{const e=new olympe.Y.stream.Bg;for(let f=0;f<d.length;f+=65536){const g=f+65536;e.write(d.subarray(f,g>d.length?d.length:g))}e.complete();e.G(c)});
540
- return c}kb(b,c){this.F.J(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.xc;e.Qc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.Z.wc($e(e));let f;null==(f=this.C.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.C.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.C.delete(b)})}ka(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.C.get(b))?e:[];f.push(g=>g?d(g):c());this.C.set(b,f)})}ab(b,c,d,e,f,g){const h=e?k=>{this.T(b,new Blob([c],{type:d}));f(k)}:
535
+ (f=g[3],void 0===f?f=!0:f.startsWith('"')&&f.endsWith('"')?f=f.substring(1,f.length-1):d.test(f)?f='true'===f.toLowerCase():e.test(f)&&(f=parseFloat(f)),a[g[1]]=f)}a=new olympe.W.Ts(a);Da(a);Fa(a.compile())}}function Ye(){console.log('The node process received a signal for graceful shutdown');let a,b;null==(b=(a=olympe.Ta.node.host).vk)||Cc(b.call(a)).then(()=>console.log('The node backend has stopped successfully')).catch(c=>console.warn(c)).finally(()=>process.exit(0))}
536
+ olympe.Y.Fe('oConfig.json',We,function(a){Oa=a;Xe()});We('version.json',function(a){Qa=a;Xe()});process.on('SIGTERM',Ye);process.on('SIGINT',Ye);process.on('SIGBREAK',Ye);process.on('SIGHUP',Ye);process.on('uncaughtException',a=>{console.error('Uncaught Exception:',a);Ye()});olympe.dc={};olympe.dc.wa={ORIGIN:'<',DESTINATION:'>'};w('olympe.dc.Direction',olympe.dc.wa);olympe.dc.nc={Zc:'ff022000000000000000',fi:'ff02200000000000000e',pj:'ff02200000000000000f'};olympe.dc.tp={VERSION:'@v',Tq:'@s'};olympe.dc.Oe={Me:'?',lh:'~'};olympe.dc.NB={zi:'online',de:'offline',uA:'invalidate'};olympe.dc.Qa={SELF:'self',SERVER:'server',rf:'remote',de:'offline'};
537
+ olympe.dc.Ob={NONE:null,vo:'ff023000000000000037',Dc:'ff023000000000000137',Uf:'ff023000000000000237',gv:'ff023000000000000337',$s:'ff023000000000000437',wA:olympe.dc.Oe.lh+'ff023000000000000037',xA:olympe.dc.Oe.lh+'ff023000000000000237',vA:olympe.dc.Oe.lh+'ff023000000000000437'};olympe.dc.aq=class extends Error{constructor(a){var b=olympe.dc.ia(),c=olympe.dc.Xd(),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.Writable=class{Vc(){}Rc(){}F(){}Ha(){}jc(){}};olympe.dc.Ku=class{Kc(){}V(){}O(){}};olympe.dc.vc=class{constructor(a){this.tag='string'===typeof a?a:a.X()}X(){return this.tag}Ga(a){return a instanceof olympe.dc.vc&&this.tag===a.tag}};olympe.dc.vc.ya=[olympe.dc.Ne];olympe.dc.vc.prototype.Ga.L=olympe.D.J.C;olympe.dc.jt=class a{constructor(b,c,d,e,f,g){this.H=b;this.Z=c;this.db=c.view;this.aa=d;this.Yb=e;this.F=f;this.O=g;this.C=new Map;this.G=Ya(new olympe.Y.Bh(6E5),(h,k)=>{URL.revokeObjectURL(k);Ze(this.db,h,a.C(h))})}ea(b,c,d,e,f){this.Fa(c).then(g=>{this.ab(b,g,d,!!this.O,e,f)}).catch(g=>this.H.error(g))}K(b){const c=this;return v(function*(){const d=f=>{f=`Failed to download file ${b.X()}: ${f}`;c.H.error(f);throw Error(f);},e=b.X();if(Wa(c.G.C,e)){const f=c.G.get(e);return c.F.G(f).then(g=>g.arrayBuffer()).then(g=>
538
+ new Uint8Array(g)).catch(d)}return c.downloadFileContent(b).then(f=>c.F.K(f)).then(f=>{if(c.O){let g;const h=null!=(g=b.get(olympe.dm.File.mimeTypeProp))?g:'application/data';c.T(e,new Blob([f],{type:h}))}return f}).catch(d)})}downloadFileContent(b){var c=b.X(),d=b.get(olympe.dm.File.C);const e=b.get(olympe.dm.File.urlProp);return e.startsWith('stream:')?this.ka(c).then(()=>this.downloadFileContent(b)):e.startsWith('blob:')?this.F.G(e).then(f=>f.arrayBuffer()).then(f=>new Uint8Array(f)):d?(d=this.db.model(b),
539
+ c=new olympe.dc.Request(olympe.dc.Request.C.Pf,olympe.dc.Xd().Ee(b),{tag:c,model:d,url:e.valueOf()}),this.Yb.request(c)):new Promise((f,g)=>{const h=N(e);h.F=olympe.net.Ba.ResponseType.Tk;this.aa.C(h,k=>{const l=k.Hc();200<=l&&300>l?f(k.getData()):g(`Failed to download file ${b}. Response code ${l}`)})})}ua(b){const c=new olympe.Y.stream.Bg;this.K(b).then(d=>{const e=new olympe.Y.stream.Bg;for(let f=0;f<d.length;f+=65536){const g=f+65536;e.write(d.subarray(f,g>d.length?d.length:g))}e.complete();e.G(c)});
540
+ return c}kb(b,c){this.F.K(c).then(d=>{d=URL.createObjectURL(new Blob([d]));const e=new olympe.dc.db.uc;e.Rc(b,(new Map).set(olympe.dm.File.urlProp.X(),d));this.Z.yc($e(e));let f;null==(f=this.C.get(b))||f.forEach(g=>g(null))}).catch(d=>{let e;null==(e=this.C.get(b))||e.forEach(f=>f(d))}).finally(()=>{this.C.delete(b)})}ka(b){return new Promise((c,d)=>{let e;const f=null!=(e=this.C.get(b))?e:[];f.push(g=>g?d(g):c());this.C.set(b,f)})}ab(b,c,d,e,f,g){const h=e?k=>{this.T(b,new Blob([c],{type:d}));f(k)}:
541
541
  f;e=this.db.model(b);e=new olympe.dc.Request(olympe.dc.Request.C.Xf,olympe.dc.Xd().Ee(b),{tag:b,model:e,content:c,mimeType:d});this.Yb.request(e).then(k=>h(null!=k?k:'')).catch(null!=g?g:this.H.error.bind(this.H))}Fa(b){return v(function*(){var c=b instanceof olympe.D.Oa?b.valueOf():b;return'string'===typeof c?Sa(c):c instanceof ArrayBuffer?new Uint8Array(c,0,c.byteLength):c instanceof Blob?(c=yield c.arrayBuffer(),new Uint8Array(c,0,c.byteLength)):c})}T(b,c){const d=olympe.dc.ga(b);b=URL.createObjectURL(c);
542
- this.G.set(d,b);const e=a.C(d);af(this.db,d,f=>{f||(this.G.delete(d),Ze(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function bf(a,b){let c=cf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.We(b);if(null===b)break;c=cf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Ct=class{constructor(a,b,c){this.H=a;this.C=b;this.db=b.view;this.F=c;this.Na=new FinalizationRegistry(d=>{this.H.J()&&this.H.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Ib([d])})}};function df(a,b){a.origin=b;return a}function ef(a,b,c){a.F.set(b,c);return a}function ff(a){let b;return null!=(b=a.F)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Qa.SELF;this.C=b;this.content=null!=c?c:null;this.G=null!=d?d:gd(olympe.auth.le()).oe();this.F=new Map}getType(){return this.type}Ac(){return this.G}pc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
543
- olympe.dc.Request.C={Lb:1,qg:10,kt:24,Zo:25,lt:28,yg:30,Rj:31,iB:32,Ve:40,Ig:41,Fn:42,Aq:43,yC:44,$h:45,Hn:46,yj:47,Xf:50,Of:51,og:52,Av:60,Ru:61,Uo:62,lA:63,Is:64,ah:65,lo:91,mt:93,Ll:95,QUERY_RESULT:97};function gf(a,b,c,d,e){const f=olympe.D.Og();a.sources.set(olympe.dc.Qa.SERVER,e.init(a));a.G?a.sources.set(olympe.dc.Qa.qf,d.init(a)):af(b,a.C,()=>{a.sources.set(olympe.dc.Qa.qf,d.init(a));const g=new Map;olympe.dc.pa.from(a.C,a.C).fb(olympe.dm.DataSource.dj).filter(olympe.dc.query.Aa.Ga(olympe.dm.DataSource.Gh,!0)).observe(f).subscribe(h=>{var k=hf(h);for(var l of k){const [p,q]=g.get(l);c.G(p);c.O(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=jf(h);for(const p of h)if(h=
544
- p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Ep(a.H,p);a.sources.set(h,q);l=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Ze(b,a.C,'router',!0)},'router')}function kf(a,b,c){a.H.debug('Router: subscribes',b);return a.sb(b.pc()).ea(b,c)}function lf(a,b,c){let d=a.F.get(b);void 0===d&&(d=[],a.F.set(b,d));d.push(c)}
545
- olympe.dc.Wu=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=f;this.G=g;this.sources=new Map;this.F=new Map;gf(this,d,e,b,c)}request(a){this.H.debug('Router: sends',a);return this.sb(a.pc()).request(a)}qd(a){const b=a.pc();if(b===this.C){let c;null==(c=this.F.get(a.getType()))||c.forEach(d=>d(a))}else olympe.N.yb.publish(b,a).catch(c=>{this.H.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Qa.qf)}};function $e(a,b){return new olympe.dc.hh(a,null!=b?b:null)}function mf(a,b){a=(new olympe.dc.transaction.zi(b)).C(a);return new olympe.dc.hh(a,null)}olympe.dc.hh=class{constructor(a,b){this.C=a;this.F=b}V(){return this.C.V()}uc(){return this.C}static C(a){const b=(new olympe.dc.transaction.zi).C(a.p);return new olympe.dc.hh(b,a.t)}ha(){const a=new olympe.dc.transaction.Tf;this.C.Uc(a);return{p:nf(a),t:this.F}}};olympe.dc.Na={};const of=olympe.dc.wa.ORIGIN,pf=olympe.dc.wa.DESTINATION,qf=new Map,rf=new Map,sf=new Map,tf=new Map;function cf(a){let b;return null!=(b=qf.get(a))?b:null}function uf(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ln||[])];return olympe.dc.oa.C(b,c,...a)}function vf(a,b){tf.set(a,b);return a}function wf(a){let b,c;return null!=(c=null==(b=qf.get(a))?void 0:b.F)?c:olympe.dc.CloudObject}
542
+ this.G.set(d,b);const e=a.C(d);af(this.db,d,f=>{f||(this.G.delete(d),Ze(this.db,d,e))},e)}static C(b){return`cacheBinary${b}`}};function bf(a,b){let c=cf(b),d=null;for(;!c&&b&&b!==d;){d=b;b=a.db.We(b);if(null===b)break;c=cf(b)}let e;return null!=(e=c)?e:null}olympe.dc.Dt=class{constructor(a,b,c){this.H=a;this.C=b;this.db=b.view;this.F=c;this.Na=new FinalizationRegistry(d=>{this.H.K()&&this.H.debug(`Collect instance ${d} (${this.db.name(d)||'no name'})`);this.C.C.Ib([d])})}};function df(a,b){a.origin=b;return a}function ef(a,b,c){a.F.set(b,c);return a}function ff(a){let b;return null!=(b=a.F)?b:new Map}olympe.dc.Request=class{constructor(a,b,c,d){this.type=a;this.origin=olympe.dc.Qa.SELF;this.C=b;this.content=null!=c?c:null;this.G=null!=d?d:gd(olympe.auth.ke()).ne();this.F=new Map}getType(){return this.type}Bc(){return this.G}pc(){return this.C}toString(){return`Request of type ${this.type}, from ${this.origin} to ${this.C}; content: ${this.content}`}};
543
+ olympe.dc.Request.C={Lb:1,qg:10,lt:24,Zo:25,mt:28,yg:30,Rj:31,jB:32,Ve:40,Ig:41,Fn:42,Bq:43,zC:44,ai:45,Hn:46,yj:47,Xf:50,Pf:51,og:52,Bv:60,Su:61,Uo:62,mA:63,Js:64,ah:65,lo:91,nt:93,Ll:95,QUERY_RESULT:97};function gf(a,b,c,d,e){const f=olympe.D.Og();a.sources.set(olympe.dc.Qa.SERVER,e.init(a));a.G?a.sources.set(olympe.dc.Qa.rf,d.init(a)):af(b,a.C,()=>{a.sources.set(olympe.dc.Qa.rf,d.init(a));const g=new Map;olympe.dc.pa.from(a.C,a.C).gb(olympe.dm.DataSource.dj).filter(olympe.dc.query.Aa.Ga(olympe.dm.DataSource.Hh,!0)).observe(f).subscribe(h=>{var k=hf(h);for(var l of k){const [p,q]=g.get(l);c.G(p);c.O(q);k=a.sources.get(l);a.sources.delete(l);var n=void 0;null==(n=k)||n.destroy()}h=jf(h);for(const p of h)if(h=
544
+ p.X(),!a.sources.has(h)){const q=new olympe.dc.sources.Fp(a.H,p);a.sources.set(h,q);l=c.C(()=>q.healthCheck());n=c.F(()=>q.destroy(),`Datasource ${h}`);g.set(h,[l,n]);q.init(a)}});Ze(b,a.C,'router',!0)},'router')}function kf(a,b,c){a.H.debug('Router: subscribes',b);return a.sb(b.pc()).ea(b,c)}function lf(a,b,c){let d=a.F.get(b);void 0===d&&(d=[],a.F.set(b,d));d.push(c)}
545
+ olympe.dc.Xu=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=f;this.G=g;this.sources=new Map;this.F=new Map;gf(this,d,e,b,c)}request(a){this.H.debug('Router: sends',a);return this.sb(a.pc()).request(a)}qd(a){const b=a.pc();if(b===this.C){let c;null==(c=this.F.get(a.getType()))||c.forEach(d=>d(a))}else olympe.N.yb.publish(b,a).catch(c=>{this.H.error(`Error while publishing the message ${a} to remote router: ${c}`)})}sb(a){let b;return null!=(b=this.sources.get(a))?b:this.sources.get(olympe.dc.Qa.rf)}};function $e(a,b){return new olympe.dc.hh(a,null!=b?b:null)}function mf(a,b){a=(new olympe.dc.transaction.th(b)).C(a);return new olympe.dc.hh(a,null)}olympe.dc.hh=class{constructor(a,b){this.C=a;this.F=b}V(){return this.C.V()}rc(){return this.C}static C(a){const b=(new olympe.dc.transaction.th).C(a.p);return new olympe.dc.hh(b,a.t)}ha(){const a=new olympe.dc.transaction.pf;this.C.Kc(a);return{p:nf(a),t:this.F}}};olympe.dc.Na={};const of=olympe.dc.wa.ORIGIN,pf=olympe.dc.wa.DESTINATION,qf=new Map,rf=new Map,sf=new Map,tf=new Map;function cf(a){let b;return null!=(b=qf.get(a))?b:null}function uf(a,b,c){let d=a;'function'===typeof a&&(d=c.entry);a=[...(d.ln||[])];return olympe.dc.oa.C(b,c,...a)}function vf(a,b){tf.set(a,b);return a}function wf(a){let b,c;return null!=(c=null==(b=qf.get(a))?void 0:b.F)?c:olympe.dc.CloudObject}
546
546
  function xf(a,b,c){const d=a+'@'+(b===pf?of:pf);if(rf.has(d))throw Error(`Try to register the same relation (${b+a}) multiple times.`);rf.set(d,c)}function yf(a){a=a.X()+'@'+a.Ja();return rf.get(a)||olympe.dc.CloudObject}function R(a,b){b.NAME=a;sf.set(a,b)}function S(a){let b;return null!=(b=a.NAME)?b:null}
547
547
  olympe.dc.oa=class{constructor(){}static C(a,b,...c){if(qf.has(a))throw Error(`Tag: ${a} - overwriting already defined CloudObject class ${qf.get(a).F.name} with ${b.name}`);let d=null;const e=c.length;if(0<e){d=Array(e);for(let f=0;f<e;f++){let g=c[f];d[f]='string'===typeof g?new olympe.W.yb(g):g}}b=new olympe.dc.Na.Entry(a,b,d);qf.set(a,b);return b.F.entry=b}static ec(a){let b,c;return null!=(c=null==(b=a.entry)?void 0:b.X())?c:null}};function zf(a,b){a.C=b}function T(a,b){b=b.cc();xf(b.X(),b.Ja(),a.F);return b}function Af(a){a.G=!0;return a}
548
- olympe.dc.Na.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.ln=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.Xm()&&b.getParameter(olympe.dc.U.Eo)){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.ma.gb('dc').error(d)}return this.ln?(a=[void 0,a].concat(Ga(b,this.ln)),new c(...a)):new c(void 0,
549
- a)}la(a){return new olympe.dc.Na.Property(a)}ra(a,b=olympe.dc.wa.DESTINATION){xf(a,b,this.F);return new olympe.dc.da.Re(a,b)}Xm(){return this.G}};w('olympe.dc.registry.Entry',olympe.dc.Na.Entry);olympe.dc.Na.Entry.prototype.addRelation=olympe.dc.Na.Entry.prototype.ra;olympe.dc.Na.Entry.prototype.addProperty=olympe.dc.Na.Entry.prototype.la;olympe.dc.Na.Entry.ya=[olympe.dc.Ne];olympe.dc.Na.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Na.Property.prototype.getTag=olympe.dc.Na.Property.prototype.X;olympe.dc.Na.Property.ya=[olympe.dc.Ne];olympe.dc.Na.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ga(a);this.direction=b;this.origin=c;this.J=d}X(){return this.tag}Ja(){return this.direction}type(){return this.J}cc(){return new olympe.dc.Na.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.J,this.origin)}Ga(a){return a instanceof olympe.dc.Na.Relation?a.X()===this.X()&&a.Ja()===this.Ja():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
550
- olympe.dc.Na.Relation.prototype.getInverse=olympe.dc.Na.Relation.prototype.cc;olympe.dc.Na.Relation.prototype.getDirection=olympe.dc.Na.Relation.prototype.Ja;olympe.dc.Na.Relation.prototype.getTag=olympe.dc.Na.Relation.prototype.X;olympe.dc.Na.Relation.ya=[olympe.dc.Ne];olympe.dc.db={};function Bf(a,b){const c=a.J,d=olympe.dc.ia(),e=olympe.dc.db.Database.F.Ai,f=olympe.dc.db.Database.F.Me,g=olympe.dc.db.Database.F.ORIGIN,h=olympe.dc.db.Database.F.DESTINATION,k=new olympe.dc.db.xc('rev-'+b.V());a.H.debug('Generate the reverse graphLayer of',b.V());b.C.forEach((l,n)=>{if(l.F()){k.F(n,olympe.dc.Ob.NONE);for(const [r,t]of l.xd())k.jc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.yd())for(const r of Cf(d,n,l.J())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
551
- y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,B)=>{k.Ha(z,B,r)}):y===h&&u.forEach((A,B)=>{k.Ha(z,r,B)})});l=l.source();k.Vc(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?Df(p,u,!0):p.Ra(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Qc(n,r);for(const [t,u,x]of l.xd())x?k.jc(t,n,u):k.Ha(t,n,u)}}});return k}
552
- function Ef(a,b,c){const d=b.V();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 Ff(b,Bf(a,b));a.G.unshift(d);a.F.set(d,e);a.J.Yr(c);a.write(b,!1)}
553
- function Gf(a,b,c){if(0>=a.O||null===c)return b;var d=a.C.findIndex(h=>h.V()===b.V()),e=a.C[d];-1<d&&a.C.splice(d,1);d=0<a.C.length?a.C.findIndex(h=>c>=h.F):0;d=-1<d?d:a.C.length;const f=a.C.slice(0,d).reduce((h,k)=>k.wc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Hf(f,c,a.C,a.O);a.C.splice(d,0,e);a.H.J()&&a.H.debug('CommitController buffer:\n',a.C.map(h=>`${h.V()} at ${h.F}`).join('\n'));return f}
554
- function If(a,b,c){return a.G.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.wc(d))?f:d},b)}
555
- olympe.dc.db.Qs=class{constructor(a,b,c,d){this.H=a;this.J=b;this.ia=c;let e;this.T=null!=(e=d.get('debug'))?e:!1;let f;this.O=null!=(f=d.get('bufferTimeout'))?f:0;this.G=[];this.F=new Map;this.C=[];b.addEventListener(olympe.dc.db.Database.C.Ro,g=>{this.C.forEach(h=>{for(const k of g)h.C.G(k)})})}wc(a,b){const c=a.V();this.F.has(c)?this.push(c,b):(a=Gf(this,If(this,a,this.G.length),b),this.write(a,!0))}push(a,b){const c=this.G.indexOf(a);if(-1<c){const d=this.F.get(a);this.G.splice(c,1);Gf(this,If(this,
556
- d.F,c),b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.nr(this.H,this.J,this.ia,this.T,b)).write(a)}};class Jf{V(){}wc(){}}function Kf(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Lc(c);b.Cb().forEach((g,h)=>{f.la(h,g);b.ea(h)});for(const [g,h,k,l]of b.ka()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ha(g,n,p);d.T(g,n,p)}}
557
- function Lf(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Lc(f);b.Cb().forEach((h,k)=>{void 0!==c.Ra(k)&&(g.la(k,h),b.ea(k))});for(const [h,k,l]of b.xd()){const n=c.vb(h,e,k);void 0!==n&&(d.T(h,f,k),n===l&&a.C.T(h,f,k))}}
558
- class Ff extends Jf{constructor(a,b){super();this.F=a;this.C=b;this.db=olympe.dc.ia()}V(){return this.F.V()}wc(a){for(const [b,c]of this.F.ka(a)){const d=b.tag();c.yd()?b.F()?a.G(d,b.J()):(this.F.G(d,c.J()),this.C.G(d,c.J())):b.yd()?(Kf(this,c,b,a),a.G(d,b.J())):Lf(this,c,b,a)}return a}}function Mf(a){clearTimeout(a.G);a.G=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.J)}
559
- class Hf extends Jf{constructor(a,b,c,d){super();this.C=a;this.F=b;this.buffer=c;this.J=d;this.G=null;Mf(this)}V(){return this.C.V()}wc(a){return a.Z(this.C)}update(a,b){this.F=b;a.Uc(this.C);Mf(this);return this}};const Nf=olympe.dc.nc.Zc,Of=olympe.dc.nc.ei,Pf=olympe.dc.wa.ORIGIN,Qf=olympe.dc.wa.DESTINATION;
560
- 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.Qa.SELF;this.H=b;this.Tc=olympe.D.$a();this.Z=olympe.dc.db.Database.G.IDLE;this.ea=new Map;this.Ub=[];this.O=[];this.ka=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.kf.C.ml;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.ad=new olympe.dc.db.kf(c,this,b,f);d.get('debug')&&this.Ak()}V(){return this.id}getState(){return this.Z}gb(){return this.H}create(b,
561
- c,d,e=!1){var f=this.G(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.aa(f,!0)}e&&f.persist();d&&this.Bc(f,d);this.F(a.C.mp,b)}update(b,c){c&&(b=this.G(b,!0),this.Bc(b,c))}ua(b){const c=this.get(b);void 0!==c&&(this.aa(c,!1),this.F(a.C.np,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Nf:Rf(c,d);break;case Of:Sf(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 Nf:Tf(c,d);
562
- break;case Of:Uf(c,d);break;default:c.unlink(b,d)}}kb(b){for(const c of b)Vf(this.G(c))}Ib(b){for(const c of b)(b=this.get(c))&&Wf(b)}Yr(b){b.forEach(c=>{this.G(c).persist()})}Td(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.C.Co,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.C.Bo,b),c&&this.F(a.C.tm,b));return d}vb(b){Xf(this.O[0],olympe.Y.Nh(),b)}T(b){this.O[0].C.delete(b)}Fa(b,...c){this.ea.has(b)&&this.ea.get(b).forEach(d=>
563
- {d(...c)})}F(b,c,...d){this.Fa(b,c,...d)}aa(b,c){this.ka.set(b,c)}Mh(b,c,d,e){let f;null!=(f=this.O[0])&&Yf(f,b).la(e?Zf+c:c,d)}yk(b,c,d,e,f){let g;null!=(g=this.O[0])&&(d===$f?f?Yf(g,b).link(c,e):Yf(g,b).unlink(c,e):f?Yf(g,b).Ib(c,e):Yf(g,b).Ub(c,e))}bc(b,c,d){let e;null!=(e=this.O[0])&&Yf(e,b).ad(c,d)}addEventListener(b,c){let d=this.ea.get(b);void 0===d&&(d=[],this.ea.set(b,d));d.push(c)}C(b,c){this.addEventListener(b,c)}ab(b){this.Ub.push(b)}J(b){return this.O.reduce((c,d)=>d.O.has(b)||c,!1)}yf(){this.Z===
564
- a.G.IDLE&&(this.Z=a.G.Bs);this.O.unshift(new olympe.dc.db.et(this,this.Tc))}De(){this.Z=a.G.ef;this.Zr();ag(this.O[0]);this.O.shift();0===this.O.length&&(this.Z=a.G.IDLE,this.Ub.forEach(b=>{b()}),bg(this.ad))}Bc(b,c){const d=a.F.Me;for(const [e,f]of c)void 0!==f&&(e[0]===d?cg(b,e.substring(1),f):b.update(e,f))}Zr(){const b=this.O[0];for(const [c,d]of this.ka)this.hc(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,dg(e)):(eg(e),e.e=f),e.db.F(f?fg.ol:fg.Cc,e.C));return g}).forEach(e=>{e=
565
- e.tag();d?Yf(b,e).create():Yf(b,e).delete()});this.ka.clear()}hc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Pf+Nf)))for(const f of c.values())null!==f.source()&&this.hc(b,f,d);return d}Ak(){const b=a.C.ol,c=a.C.Tj,d=new Set,e=new Map;this.C(a.C.mp,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===Of&&g[1]===Qf){const h=g[2];this.get(h).Ia()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.ab(()=>{d.forEach(f=>{const g=this.get(f);
566
- g&&null===g.model()&&this.H.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.H.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()}`)});e.clear()})}};olympe.dc.db.Database.F={Ai:'$',xt:'~',Me:'?',Mk:'=',jp:'|',$k:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};
567
- olympe.dc.db.Database.C={Bo:0,Co:1,dr:2,tm:3,Vn:4,Wn:5,ol:6,Cc:7,Tj:8,bm:9,mp:10,np:11,uq:12,gz:13,fz:14,vv:15,Ro:16};olympe.dc.db.Database.G={IDLE:0,Bs:1,ef:2};function gg(a,b,c=[]){const d=b.V();Ef(a.F,b,c);return e=>{if(null!==e)a.F.push(d,e);else{e=a.F;var f=e.F.get(d);if(void 0!==f){const g=e.G.indexOf(d);e.G.splice(g,1);f=If(e,f.C,e.G.length);e.write(Gf(e,f,Date.now()),!1);e.F.delete(d)}}}}function hg(a,b){a.C.ab(b)}olympe.dc.db.$s=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.view=c;this.F=new olympe.dc.db.Qs(a,b,c,d);this.Vx=new olympe.dc.db.tu(a,c,b,e)}gb(){return this.H}wc(a){this.F.wc(a.uc(),a.F)}};const ig=olympe.dc.db.Database.F.ORIGIN,jg=olympe.dc.db.Database.F.DESTINATION,kg=olympe.dc.db.Database.F.Ai,lg=olympe.dc.db.Database.F.Me,mg=olympe.dc.db.Database.F.Mk,ng=olympe.dc.db.Database.F.jp,og=ig+jg,pg=kg+kg,qg=olympe.dc.db.Database.G;let rg=0;function Ze(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=sg(e,'',c);void 0!==f&&(a.C.getState()!==qg.ef||e.J()&&!d||a.C.T(c),d||!e.Ia()&&!e.J()||f(!1,b))}}
548
+ olympe.dc.Na.Entry=class{constructor(a,b,c){this.tag=a;this.F=b;this.ln=c||null;this.C=null;this.G=!1}X(){return this.tag}instantiate(a,b){const c=this.F;if(this.Xm()&&b.getParameter(olympe.dc.U.Eo)){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.ma.hb('dc').error(d)}return this.ln?(a=[void 0,a].concat(Ga(b,this.ln)),new c(...a)):new c(void 0,
549
+ a)}la(a){return new olympe.dc.Na.Property(a)}ra(a,b=olympe.dc.wa.DESTINATION){xf(a,b,this.F);return new olympe.dc.da.Re(a,b)}Xm(){return this.G}};w('olympe.dc.registry.Entry',olympe.dc.Na.Entry);olympe.dc.Na.Entry.prototype.addRelation=olympe.dc.Na.Entry.prototype.ra;olympe.dc.Na.Entry.prototype.addProperty=olympe.dc.Na.Entry.prototype.la;olympe.dc.Na.Entry.ya=[olympe.dc.Ne];olympe.dc.Na.Property=class{constructor(a){this.tag=a}X(){return this.tag}toString(){return`Property: ${this.tag}`}};olympe.dc.Na.Property.prototype.getTag=olympe.dc.Na.Property.prototype.X;olympe.dc.Na.Property.ya=[olympe.dc.Ne];olympe.dc.Na.Relation=class{constructor(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.CloudObject){this.tag=olympe.dc.ga(a);this.direction=b;this.origin=c;this.K=d}X(){return this.tag}Ja(){return this.direction}type(){return this.K}cc(){return new olympe.dc.Na.Relation(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION,this.K,this.origin)}Ga(a){return a instanceof olympe.dc.Na.Relation?a.X()===this.X()&&a.Ja()===this.Ja():!1}toString(){return`${this.direction}${olympe.dc.ia().name(this.tag)} (${this.tag})`}};
550
+ olympe.dc.Na.Relation.prototype.getInverse=olympe.dc.Na.Relation.prototype.cc;olympe.dc.Na.Relation.prototype.getDirection=olympe.dc.Na.Relation.prototype.Ja;olympe.dc.Na.Relation.prototype.getTag=olympe.dc.Na.Relation.prototype.X;olympe.dc.Na.Relation.ya=[olympe.dc.Ne];olympe.dc.db={};function Bf(a,b){const c=a.K,d=olympe.dc.ia(),e=olympe.dc.db.Database.F.Ai,f=olympe.dc.db.Database.F.Me,g=olympe.dc.db.Database.F.ORIGIN,h=olympe.dc.db.Database.F.DESTINATION,k=new olympe.dc.db.uc('rev-'+b.V());a.H.debug('Generate the reverse graphLayer of',b.V());b.C.forEach((l,n)=>{if(l.F()){k.F(n,olympe.dc.Ob.NONE);for(const [r,t]of l.xd())k.jc(r,n,t)}else{var p=c.get(n);if(void 0!==p)if(l.yd())for(const r of Cf(d,n,l.K())){l=c.get(r);const t=new Map;l.forEach((u,x)=>{const y=x[0],z=x.substring(1);
551
+ y===e?t.set(z,u):y===f?t.set(x,u):y===g?u.forEach((A,B)=>{k.Ha(z,B,r)}):y===h&&u.forEach((A,B)=>{k.Ha(z,r,B)})});l=l.source();k.Vc(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?Df(p,u,!0):p.Ra(u,!0);let x;r.set(t,null!=(x=q)?x:null)}0<r.size&&k.Rc(n,r);for(const [t,u,x]of l.xd())x?k.jc(t,n,u):k.Ha(t,n,u)}}});return k}
552
+ function Ef(a,b,c){const d=b.V();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 Ff(b,Bf(a,b));a.G.unshift(d);a.F.set(d,e);a.K.Zr(c);a.write(b,!1)}
553
+ function Gf(a,b,c){if(0>=a.O||null===c)return b;var d=a.C.findIndex(h=>h.V()===b.V()),e=a.C[d];-1<d&&a.C.splice(d,1);d=0<a.C.length?a.C.findIndex(h=>c>=h.F):0;d=-1<d?d:a.C.length;const f=a.C.slice(0,d).reduce((h,k)=>k.yc(h),b);let g;e=null!=(g=null==e?void 0:e.update(f,c))?g:new Hf(f,c,a.C,a.O);a.C.splice(d,0,e);a.H.K()&&a.H.debug('CommitController buffer:\n',a.C.map(h=>`${h.V()} at ${h.F}`).join('\n'));return f}
554
+ function If(a,b,c){return a.G.slice(0,c).map(d=>a.F.get(d)).reduce((d,e)=>{let f;return null!=(f=null==e?void 0:e.yc(d))?f:d},b)}
555
+ olympe.dc.db.Rs=class{constructor(a,b,c,d){this.H=a;this.K=b;this.ia=c;let e;this.T=null!=(e=d.get('debug'))?e:!1;let f;this.O=null!=(f=d.get('bufferTimeout'))?f:0;this.G=[];this.F=new Map;this.C=[];b.addEventListener(olympe.dc.db.Database.C.Ro,g=>{this.C.forEach(h=>{for(const k of g)h.C.G(k)})})}yc(a,b){const c=a.V();this.F.has(c)?this.push(c,b):(a=Gf(this,If(this,a,this.G.length),b),this.write(a,!0))}push(a,b){const c=this.G.indexOf(a);if(-1<c){const d=this.F.get(a);this.G.splice(c,1);Gf(this,If(this,
556
+ d.F,c),b);this.F.delete(a)}}write(a,b){(new olympe.dc.db.qr(this.H,this.K,this.ia,this.T,b)).write(a)}};class Jf{V(){}yc(){}}function Kf(a,b,c,d){const e=olympe.dc.wa.DESTINATION;c=c.tag();const f=a.C.Mc(c);b.Cb().forEach((g,h)=>{f.la(h,g);b.ea(h)});for(const [g,h,k,l]of b.ka()){if(!l)continue;const n=h===e?c:k,p=h===e?k:c;a.C.Ha(g,n,p);d.T(g,n,p)}}
557
+ function Lf(a,b,c,d){const e=olympe.dc.wa.DESTINATION,f=c.tag(),g=a.C.Mc(f);b.Cb().forEach((h,k)=>{void 0!==c.Ra(k)&&(g.la(k,h),b.ea(k))});for(const [h,k,l]of b.xd()){const n=c.vb(h,e,k);void 0!==n&&(d.T(h,f,k),n===l&&a.C.T(h,f,k))}}
558
+ class Ff extends Jf{constructor(a,b){super();this.F=a;this.C=b;this.db=olympe.dc.ia()}V(){return this.F.V()}yc(a){for(const [b,c]of this.F.ka(a)){const d=b.tag();c.yd()?b.F()?a.G(d,b.K()):(this.F.G(d,c.K()),this.C.G(d,c.K())):b.yd()?(Kf(this,c,b,a),a.G(d,b.K())):Lf(this,c,b,a)}return a}}function Mf(a){clearTimeout(a.G);a.G=setTimeout(()=>{a.buffer.splice(a.buffer.indexOf(a),1)},a.K)}
559
+ class Hf extends Jf{constructor(a,b,c,d){super();this.C=a;this.F=b;this.buffer=c;this.K=d;this.G=null;Mf(this)}V(){return this.C.V()}yc(a){return a.Z(this.C)}update(a,b){this.F=b;a.Kc(this.C);Mf(this);return this}};const Nf=olympe.dc.nc.Zc,Of=olympe.dc.nc.fi,Pf=olympe.dc.wa.ORIGIN,Qf=olympe.dc.wa.DESTINATION;
560
+ 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.Qa.SELF;this.H=b;this.Uc=olympe.D.$a();this.Z=olympe.dc.db.Database.G.IDLE;this.ea=new Map;this.Vb=[];this.O=[];this.ka=new Map;var f;b=null!=(f=d.get('garbageCollector'))?f:olympe.dc.db.kf.C.ml;let g;f=null!=(g=d.get('garbageCollectorDelay'))?g:5E3;this.ad=new olympe.dc.db.kf(c,this,b,f);d.get('debug')&&this.Ak()}V(){return this.id}getState(){return this.Z}hb(){return this.H}create(b,
561
+ c,d,e=!1){var f=this.G(b,!0);if(!f.e&&null!==c&&(null===f.G||f.G===c)){f.G=c;let g;(null==(g=f.model())?0:g.e)&&f.db.aa(f,!0)}e&&f.persist();d&&this.Cc(f,d);this.F(a.C.np,b)}update(b,c){c&&(b=this.G(b,!0),this.Cc(b,c))}ua(b){const c=this.get(b);void 0!==c&&(this.aa(c,!1),this.F(a.C.op,b))}link(b,c,d){c=this.G(c,!0);d=this.G(d,!0);switch(b){case Nf:Rf(c,d);break;case Of:Sf(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 Nf:Tf(c,d);
562
+ break;case Of:Uf(c,d);break;default:c.unlink(b,d)}}kb(b){for(const c of b)Vf(this.G(c))}Ib(b){for(const c of b)(b=this.get(c))&&Wf(b)}Zr(b){b.forEach(c=>{this.G(c).persist()})}Td(b){const c=this.get(b);void 0!==c&&(c.clear(),super.delete(b),this.F(a.C.Co,b))}G(b,c=!1){let d=this.get(b);void 0===d&&(d=new olympe.dc.db.Instance(b,this),this.set(b,d),this.F(a.C.Bo,b),c&&this.F(a.C.tm,b));return d}vb(b){Xf(this.O[0],olympe.Y.Oh(),b)}T(b){this.O[0].C.delete(b)}Fa(b,...c){this.ea.has(b)&&this.ea.get(b).forEach(d=>
563
+ {d(...c)})}F(b,c,...d){this.Fa(b,c,...d)}aa(b,c){this.ka.set(b,c)}Nh(b,c,d,e){let f;null!=(f=this.O[0])&&Yf(f,b).la(e?Zf+c:c,d)}yk(b,c,d,e,f){let g;null!=(g=this.O[0])&&(d===$f?f?Yf(g,b).link(c,e):Yf(g,b).unlink(c,e):f?Yf(g,b).Ib(c,e):Yf(g,b).Vb(c,e))}bc(b,c,d){let e;null!=(e=this.O[0])&&Yf(e,b).ad(c,d)}addEventListener(b,c){let d=this.ea.get(b);void 0===d&&(d=[],this.ea.set(b,d));d.push(c)}C(b,c){this.addEventListener(b,c)}ab(b){this.Vb.push(b)}K(b){return this.O.reduce((c,d)=>d.O.has(b)||c,!1)}zf(){this.Z===
564
+ a.G.IDLE&&(this.Z=a.G.Cs);this.O.unshift(new olympe.dc.db.ft(this,this.Uc))}De(){this.Z=a.G.ef;this.$r();ag(this.O[0]);this.O.shift();0===this.O.length&&(this.Z=a.G.IDLE,this.Vb.forEach(b=>{b()}),bg(this.ad))}Cc(b,c){const d=a.F.Me;for(const [e,f]of c)void 0!==f&&(e[0]===d?cg(b,e.substring(1),f):b.update(e,f))}$r(){const b=this.O[0];for(const [c,d]of this.ka)this.hc(new Set,c).filter(e=>{var f=d;const g=e.e!==f;g&&(f?(e.e=f,dg(e)):(eg(e),e.e=f),e.db.F(f?fg.ol:fg.Dc,e.C));return g}).forEach(e=>{e=
565
+ e.tag();d?Yf(b,e).create():Yf(b,e).delete()});this.ka.clear()}hc(b,c,d=[]){const e=c.tag();if(!b.has(e)&&(b.add(e),d.push(c),c=c.get(Pf+Nf)))for(const f of c.values())null!==f.source()&&this.hc(b,f,d);return d}Ak(){const b=a.C.ol,c=a.C.Tj,d=new Set,e=new Map;this.C(a.C.np,f=>{d.add(f)});this.C(b,f=>{d.delete(f);e.delete(f)});this.C(c,(f,...g)=>{if(g[0]===Of&&g[1]===Qf){const h=g[2];this.get(h).Ia()||(g=e.get(h)||new Set,0===g.size&&e.set(h,g),g.add(f))}});this.ab(()=>{d.forEach(f=>{const g=this.get(f);
566
+ g&&null===g.model()&&this.H.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.H.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()}`)});e.clear()})}};olympe.dc.db.Database.F={Ai:'$',yt:'~',Me:'?',Mk:'=',kp:'|',$k:'@',ORIGIN:olympe.dc.wa.ORIGIN,DESTINATION:olympe.dc.wa.DESTINATION};
567
+ olympe.dc.db.Database.C={Bo:0,Co:1,er:2,tm:3,Vn:4,Wn:5,ol:6,Dc:7,Tj:8,bm:9,np:10,op:11,vq:12,hz:13,gz:14,wv:15,Ro:16};olympe.dc.db.Database.G={IDLE:0,Cs:1,ef:2};function gg(a,b,c=[]){const d=b.V();Ef(a.F,b,c);return e=>{if(null!==e)a.F.push(d,e);else{e=a.F;var f=e.F.get(d);if(void 0!==f){const g=e.G.indexOf(d);e.G.splice(g,1);f=If(e,f.C,e.G.length);e.write(Gf(e,f,Date.now()),!1);e.F.delete(d)}}}}function hg(a,b){a.C.ab(b)}olympe.dc.db.at=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.view=c;this.F=new olympe.dc.db.Rs(a,b,c,d);this.Wx=new olympe.dc.db.uu(a,c,b,e)}hb(){return this.H}yc(a){this.F.yc(a.rc(),a.F)}};const ig=olympe.dc.db.Database.F.ORIGIN,jg=olympe.dc.db.Database.F.DESTINATION,kg=olympe.dc.db.Database.F.Ai,lg=olympe.dc.db.Database.F.Me,mg=olympe.dc.db.Database.F.Mk,ng=olympe.dc.db.Database.F.kp,og=ig+jg,pg=kg+kg,qg=olympe.dc.db.Database.G;let rg=0;function Ze(a,b,c,d=!1){const e=U(a,b);if(null!==e){const f=sg(e,'',c);void 0!==f&&(a.C.getState()!==qg.ef||e.K()&&!d||a.C.T(c),d||!e.Ia()&&!e.K()||f(!1,b))}}
568
568
  function af(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:tg();ug(a,'',d,c)&&a.Ia()&&c(!0,b);return d}function Cf(a,b,c){return{[Symbol.iterator]:function*(d,e,f){const g=(new Set).add(olympe.dc.ga(e));for(const h of g)yield h,d.tk(h,f).forEach(([k,,,l])=>{l&&g.add(k)})}.bind(null,a,b,c)}}function tg(){++rg;return String(rg)}
569
569
  function vg(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=olympe.dc.ga(c);b=kg+c;e=null!=e?e:tg();if(ug(a,b,e,d)&&a.Ia()){let f=!1;b=a.get(b);void 0===b&&(f=!0,b=a.get(mg+c));void 0!==b&&d(b,f)}return e}function U(a,b,c=!1){if(b)return a=a.C.get(olympe.dc.ga(b)),!a||c&&!a.Ia()?null:a;throw Error('DBView: Impossible to get instance, provided tag is null or undefined.');}function wg(a,b,c,d){b=U(a,b);null!==b&&(c=olympe.dc.ga(c),sg(b,kg+c,d),a.C.getState()===qg.ef&&a.C.T(d))}
570
- function xg(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:tg();ug(a,pg,d,c)&&a.Ia()&&a.forEach((e,f)=>{const g=f[0];g!==kg&&g!==mg||c(f.substring(1),e,g===mg)});return d}function yg(a,b,c){b=U(a,b);null!==b&&(sg(b,pg,c),a.C.getState()===qg.ef&&a.C.T(c))}function zg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ia()||!c&&g.J())e?d(b.substring(1),b[0],c,h):d(c,h)})}
571
- function V(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=c.Ja()+c.X();e=null!=e?e:tg();(d=Ag(a,c,e,d))&&a.Ia()&&zg(a,c,!0,d,!1);return e}function Bg(a,b,c,d){const e=a.C.G(olympe.dc.ga(b));a=null!=d?d:tg();const f=Ag(e,og,a,c);f&&e.Ia()&&e.forEach((g,h)=>{g=h[0];g!==ig&&g!==jg||zg(e,h,!0,f,!0)})}function Cg(a,b,c){const d=U(a,b);if(null!==d){const e=sg(d,og,c);void 0!==e&&(a.C.getState()!==qg.ef||d.J()||a.C.T(c),!d.Ia()&&!d.J()||d.forEach((f,g)=>{f=g[0];(f===ig||f===jg)&&e&&zg(d,g,!1,e,!0)}))}}
572
- function Dg(a,b,c){b=U(a,b,!1);if(!b||c===olympe.dc.Ob.NONE)return[];const d=olympe.dm.Relation.C.em,e=olympe.dm.Relation.C.Tu,f=olympe.dm.Relation.C.qm,g=olympe.dm.Relation.C.vq,h=c[0]===olympe.dc.Oe.lh,k=[];b.forEach((l,n)=>{const p=n[0];if(!h&&l instanceof olympe.dc.Fc&&(p===kg||p===lg))(l=a.C.get(l.X()))&&k.push([l,n.substring(1),null,!0]);else if(p===ig||p===jg){const q=n.substring(1),r=Eg(a,q,c),t=p===ig?d|e:f|g;t&r&&l.forEach(u=>{k.push([u,q,p,!!(t&10&r)])})}});if(h&&void 0!==b.F){const [l,
573
- n]=void 0!==b.F?[b.F.tag,b.F.Ka]:null;b=a.C.get(l);k.push([b,n,null,!0])}return k}function Fg(a,b,c,d,e){const f=a.C.G(olympe.dc.ga(b));e=null!=e?e:tg();const g=Ag(f,ng+c,e,d);g&&f.Ia()&&Dg(a,b,c).forEach(([h,...k])=>{h.Ia()&&g(...k,!0,h.tag())})}function Gg(a,b,c,d){const e=U(a,b);if(null!==e){const f=sg(e,ng+c,d);void 0!==f&&(a.C.getState()!==qg.ef||e.J()||a.C.T(d),!e.Ia()&&!e.J()||Dg(a,b,c).forEach(([g,...h])=>{(g.Ia()||g.J())&&f(...h,!1,g.tag())}))}}
570
+ function xg(a,b,c,d){a=a.C.G(olympe.dc.ga(b));d=null!=d?d:tg();ug(a,pg,d,c)&&a.Ia()&&a.forEach((e,f)=>{const g=f[0];g!==kg&&g!==mg||c(f.substring(1),e,g===mg)});return d}function yg(a,b,c){b=U(a,b);null!==b&&(sg(b,pg,c),a.C.getState()===qg.ef&&a.C.T(c))}function zg(a,b,c,d,e){let f;null==(f=a.get(b))||f.forEach((g,h)=>{if(g.Ia()||!c&&g.K())e?d(b.substring(1),b[0],c,h):d(c,h)})}
571
+ function V(a,b,c,d,e){a=a.C.G(olympe.dc.ga(b));c=c.Ja()+c.X();e=null!=e?e:tg();(d=Ag(a,c,e,d))&&a.Ia()&&zg(a,c,!0,d,!1);return e}function Bg(a,b,c,d){const e=a.C.G(olympe.dc.ga(b));a=null!=d?d:tg();const f=Ag(e,og,a,c);f&&e.Ia()&&e.forEach((g,h)=>{g=h[0];g!==ig&&g!==jg||zg(e,h,!0,f,!0)})}function Cg(a,b,c){const d=U(a,b);if(null!==d){const e=sg(d,og,c);void 0!==e&&(a.C.getState()!==qg.ef||d.K()||a.C.T(c),!d.Ia()&&!d.K()||d.forEach((f,g)=>{f=g[0];(f===ig||f===jg)&&e&&zg(d,g,!1,e,!0)}))}}
572
+ function Dg(a,b,c){b=U(a,b,!1);if(!b||c===olympe.dc.Ob.NONE)return[];const d=olympe.dm.Relation.C.em,e=olympe.dm.Relation.C.Uu,f=olympe.dm.Relation.C.qm,g=olympe.dm.Relation.C.wq,h=c[0]===olympe.dc.Oe.lh,k=[];b.forEach((l,n)=>{const p=n[0];if(!h&&l instanceof olympe.dc.vc&&(p===kg||p===lg))(l=a.C.get(l.X()))&&k.push([l,n.substring(1),null,!0]);else if(p===ig||p===jg){const q=n.substring(1),r=Eg(a,q,c),t=p===ig?d|e:f|g;t&r&&l.forEach(u=>{k.push([u,q,p,!!(t&10&r)])})}});if(h&&void 0!==b.F){const [l,
573
+ n]=void 0!==b.F?[b.F.tag,b.F.Ka]:null;b=a.C.get(l);k.push([b,n,null,!0])}return k}function Fg(a,b,c,d,e){const f=a.C.G(olympe.dc.ga(b));e=null!=e?e:tg();const g=Ag(f,ng+c,e,d);g&&f.Ia()&&Dg(a,b,c).forEach(([h,...k])=>{h.Ia()&&g(...k,!0,h.tag())})}function Gg(a,b,c,d){const e=U(a,b);if(null!==e){const f=sg(e,ng+c,d);void 0!==f&&(a.C.getState()!==qg.ef||e.K()||a.C.T(d),!e.Ia()&&!e.K()||Dg(a,b,c).forEach(([g,...h])=>{(g.Ia()||g.K())&&f(...h,!1,g.tag())}))}}
574
574
  function Hg(a,b){a=U(a,b,!0);b=new Map;if(a)for(const [c,d]of a)c[0]===lg&&b.set(c.substring(1),d);return b}function Eg(a,b,c){if(c===olympe.dc.Ob.NONE)return 0;const d=c[0]===olympe.dc.Oe.lh;c=d?c.substring(1):c;a=a.Ra(b,c,!0)||0;return d?((a&3)<<2)+((a&12)>>2):a}function Ig(a,b){return function*(c){if(c)for(const [d,e]of c)if(c=d[0],c===ig||c===jg){const f=d.substring(1);for(const g of e.keys())yield[f,c,g]}}(U(a,b,!0))}
575
575
  function Jg(a,b,c){if(!a.Ia(b))return a.H.warn(`No instance found with tag ${b}`),new Map;const d=new Map,e=[olympe.dc.ga(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.H.debug(`Found ${d.size} instances in sub-tree rooted at ${olympe.dc.ga(b)}`);return d}function Kg(a,b,c,d){return(c=(a=U(a,b,!0))&&a.get(d+c))?Array.from(c.values()).filter(e=>e.Ia()).length:0}
576
- olympe.dc.lb=class{constructor(a,b){this.H=a;this.C=b}V(){return this.C.V()}F(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ja()+b.X();const e=sg(a,b,c);void 0!==e&&(this.C.getState()!==qg.ef||a.J()&&!d||this.C.T(c),d||!a.Ia()&&!a.J()||zg(a,b,!1,e,!1))}}Ia(a){a=this.C.get(olympe.dc.ga(a));return!(null==a||!a.Ia())}name(a){let b,c;return null!=(c=null==(b=U(this,a))?void 0:b.Ra(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}We(a){return(a=(a=U(this,
577
- a,!0))&&a.We())?a.tag():null}Sh(a){a=U(this,a,!0);return!(!a||!a.We())}Rb(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Ef(a.tag(),b))}source(a){return(a=U(this,a,!0))&&a.source()}Gf(a){a=U(this,a,!1);return!a||a.O}Ra(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.Ra(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===kg||!b&&c===mg)&&a.set(d.substring(1),e);return a}tk(a,b){return Dg(this,a,b).filter(([c])=>c.Ia()).map(([c,
578
- ...d])=>[c.tag(),...d])}bb(a,b){a=U(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.Ia()&&a.push(c.tag());return a}Xr(a,b,c){let d,e;a=null==(d=U(this,a,!0))?void 0:null==(e=d.get(b.Ja()+b.X()))?void 0:e.get(olympe.dc.ga(c));return!(null==a||!a.Ia())}Tm(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Ja()+c.X()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
579
- U(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.H.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.Ia())?a.tag():null}Rg(a,b,c){a=olympe.dc.ga(a);const d=Jg(this,a,b);d.delete(a);return c?(c=olympe.dc.ga(c),d.has(c)?Array.from(Jg(this,c,b.cc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Fr(a,b,c){if(!this.Ia(a))return null;b=Jg(this,
580
- a,b);const d=[olympe.dc.ga(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}Mm(a,b,c){return this.Tm(a,b).find(c)||null}rw(a,b,c){return this.Tm(a,b).filter(c)}Lr(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.We();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.ga(a)} but one of them does not exists (${c.tag()})`,
581
- Error(a);null!==c&&e.push(c)}c=U(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())}Ef(a,b){const c=olympe.dc.ga(b);return!!this.Fr(a,olympe.dc.CloudObject.extendRel,d=>d===c)}bd(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.lb.prototype.getInstances=olympe.dc.lb.prototype.bd;olympe.dc.lb.prototype.isExtending=olympe.dc.lb.prototype.Ef;
582
- olympe.dc.lb.prototype.getExtendedModels=olympe.dc.lb.prototype.Lr;olympe.dc.lb.prototype.findAllRelated=olympe.dc.lb.prototype.rw;olympe.dc.lb.prototype.findRelated=olympe.dc.lb.prototype.Mm;olympe.dc.lb.prototype.findRecursive=olympe.dc.lb.prototype.Fr;olympe.dc.lb.prototype.getRecursiveRelated=olympe.dc.lb.prototype.Rg;olympe.dc.lb.prototype.getUniqueRelated=olympe.dc.lb.prototype.Jb;olympe.dc.lb.prototype.getMultiRelated=olympe.dc.lb.prototype.Tm;olympe.dc.lb.prototype.isRelated=olympe.dc.lb.prototype.Xr;
583
- olympe.dc.lb.prototype.getRelated=olympe.dc.lb.prototype.bb;olympe.dc.lb.prototype.getProperties=olympe.dc.lb.prototype.Cb;olympe.dc.lb.prototype.getProperty=olympe.dc.lb.prototype.Ra;olympe.dc.lb.prototype.isPersisted=olympe.dc.lb.prototype.Gf;olympe.dc.lb.prototype.instanceOf=olympe.dc.lb.prototype.Rb;olympe.dc.lb.prototype.isModel=olympe.dc.lb.prototype.Sh;olympe.dc.lb.prototype.extension=olympe.dc.lb.prototype.We;olympe.dc.lb.prototype.model=olympe.dc.lb.prototype.model;
584
- olympe.dc.lb.prototype.name=olympe.dc.lb.prototype.name;olympe.dc.lb.prototype.exist=olympe.dc.lb.prototype.Ia;const Lg=olympe.dc.db.Database.F.ORIGIN,$f=olympe.dc.db.Database.F.DESTINATION,Zf=olympe.dc.db.Database.F.Mk,Mg=olympe.dc.db.Database.F.Ai,Ng=olympe.dc.db.Database.F.jp,Og=olympe.dc.db.Database.F.$k,Pg=Lg+$f,Qg=Mg+Mg,Rg=Array.from(Object.values(olympe.dc.Ob)).filter(a=>null!==a);function Xf(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
585
- function ag(a){const b=a.J;a.F.forEach((c,d)=>{var e=b.get(d);if(c.F()||c.yd()){var f=e.get(Og);f&&Sg(a,f,c.F(),d);c.yd()&&a.O.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===Zf,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(Og+Mg+h);q&&Sg(f,q,l,g);(k=k.get(Og+Qg))&&Sg(f,k,h,l,g)}for(const n of c.ka())Tg(a,e,...n);(e=c.aa)&&Ug(a,b.get(e),c.bc,!c.yd(),d)});a.F.clear();a.G.clear();Vg(a)}function Yf(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.mh(b),a.F.set(b,c));return c}
576
+ olympe.dc.lb=class{constructor(a,b){this.H=a;this.C=b}V(){return this.C.V()}F(a,b,c,d=!1){a=U(this,a);if(null!==a){b=b.Ja()+b.X();const e=sg(a,b,c);void 0!==e&&(this.C.getState()!==qg.ef||a.K()&&!d||this.C.T(c),d||!a.Ia()&&!a.K()||zg(a,b,!1,e,!1))}}Ia(a){a=this.C.get(olympe.dc.ga(a));return!(null==a||!a.Ia())}name(a){let b,c;return null!=(c=null==(b=U(this,a))?void 0:b.Ra(olympe.dc.CloudObject.nameProp.X()))?c:''}model(a){return(a=(a=U(this,a,!0))?a.model():null)?a.tag():null}We(a){return(a=(a=U(this,
577
+ a,!0))&&a.We())?a.tag():null}Th(a){a=U(this,a,!0);return!(!a||!a.We())}Sb(a,b){a=(a=U(this,a,!0))&&a.model();return!(!a||!this.Ff(a.tag(),b))}source(a){return(a=U(this,a,!0))&&a.source()}Hf(a){a=U(this,a,!1);return!a||a.O}Ra(a,b,c){let d;a=null==(d=U(this,a,!0))?void 0:d.Ra(olympe.dc.ga(b),c);return void 0!==a?a:null}Cb(a,b=!1){var c=U(this,a,!0);a=new Map;if(c)for(const [d,e]of c)c=d[0],(c===kg||!b&&c===mg)&&a.set(d.substring(1),e);return a}tk(a,b){return Dg(this,a,b).filter(([c])=>c.Ia()).map(([c,
578
+ ...d])=>[c.tag(),...d])}bb(a,b){a=U(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.Ia()&&a.push(c.tag());return a}Yr(a,b,c){let d,e;a=null==(d=U(this,a,!0))?void 0:null==(e=d.get(b.Ja()+b.X()))?void 0:e.get(olympe.dc.ga(c));return!(null==a||!a.Ia())}Tm(a,b){a=U(this,a,!0);if(!a)return[];a=[a.tag()];for(const c of b){b=[];for(const d of a)if(a=U(this,d,!0).get(c.Ja()+c.X()),void 0!==a)for(const e of a.values())e.Ia()&&b.push(e.tag());a=b}return a}Jb(a,b){var c=
579
+ U(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.H.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.Ia())?a.tag():null}Rg(a,b,c){a=olympe.dc.ga(a);const d=Jg(this,a,b);d.delete(a);return c?(c=olympe.dc.ga(c),d.has(c)?Array.from(Jg(this,c,b.cc()).keys()).filter(e=>d.has(e)):[]):Array.from(d.keys())}Gr(a,b,c){if(!this.Ia(a))return null;b=Jg(this,
580
+ a,b);const d=[olympe.dc.ga(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}Mm(a,b,c){return this.Tm(a,b).find(c)||null}sw(a,b,c){return this.Tm(a,b).filter(c)}Mr(a,b=olympe.dc.CloudObject){var c=U(this,a,!0);const d=b&&U(this,b,!0),e=[c];for(;c&&c!==d;){c=c.We();if(e.includes(c))throw Error(`Cycle detected when following recursively extend relations from base model instance "${a}".`);if(c&&!c.Ia())throw a=`Try to get all extensions of the model ${olympe.dc.ga(a)} but one of them does not exists (${c.tag()})`,
581
+ Error(a);null!==c&&e.push(c)}c=U(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())}Ff(a,b){const c=olympe.dc.ga(b);return!!this.Gr(a,olympe.dc.CloudObject.extendRel,d=>d===c)}bd(a){return this.bb(a,olympe.dc.CloudObject.instancesRel)}};olympe.dc.lb.prototype.getInstances=olympe.dc.lb.prototype.bd;olympe.dc.lb.prototype.isExtending=olympe.dc.lb.prototype.Ff;
582
+ olympe.dc.lb.prototype.getExtendedModels=olympe.dc.lb.prototype.Mr;olympe.dc.lb.prototype.findAllRelated=olympe.dc.lb.prototype.sw;olympe.dc.lb.prototype.findRelated=olympe.dc.lb.prototype.Mm;olympe.dc.lb.prototype.findRecursive=olympe.dc.lb.prototype.Gr;olympe.dc.lb.prototype.getRecursiveRelated=olympe.dc.lb.prototype.Rg;olympe.dc.lb.prototype.getUniqueRelated=olympe.dc.lb.prototype.Jb;olympe.dc.lb.prototype.getMultiRelated=olympe.dc.lb.prototype.Tm;olympe.dc.lb.prototype.isRelated=olympe.dc.lb.prototype.Yr;
583
+ olympe.dc.lb.prototype.getRelated=olympe.dc.lb.prototype.bb;olympe.dc.lb.prototype.getProperties=olympe.dc.lb.prototype.Cb;olympe.dc.lb.prototype.getProperty=olympe.dc.lb.prototype.Ra;olympe.dc.lb.prototype.isPersisted=olympe.dc.lb.prototype.Hf;olympe.dc.lb.prototype.instanceOf=olympe.dc.lb.prototype.Sb;olympe.dc.lb.prototype.isModel=olympe.dc.lb.prototype.Th;olympe.dc.lb.prototype.extension=olympe.dc.lb.prototype.We;olympe.dc.lb.prototype.model=olympe.dc.lb.prototype.model;
584
+ olympe.dc.lb.prototype.name=olympe.dc.lb.prototype.name;olympe.dc.lb.prototype.exist=olympe.dc.lb.prototype.Ia;const Lg=olympe.dc.db.Database.F.ORIGIN,$f=olympe.dc.db.Database.F.DESTINATION,Zf=olympe.dc.db.Database.F.Mk,Mg=olympe.dc.db.Database.F.Ai,Ng=olympe.dc.db.Database.F.kp,Og=olympe.dc.db.Database.F.$k,Pg=Lg+$f,Qg=Mg+Mg,Rg=Array.from(Object.values(olympe.dc.Ob)).filter(a=>null!==a);function Xf(a,b,c){let d=a.C.get(b);void 0===d&&(d=[],a.C.set(b,d));a.buffer.push([b,d.length]);d.push(c)}
585
+ function ag(a){const b=a.K;a.F.forEach((c,d)=>{var e=b.get(d);if(c.F()||c.yd()){var f=e.get(Og);f&&Sg(a,f,c.F(),d);c.yd()&&a.O.add(d)}for(const [n,p]of c.Cb()){var g=n[0]===Zf,h=g?n.substring(1):n;f=a;var k=e,l=p;const q=k.get(Og+Mg+h);q&&Sg(f,q,l,g);(k=k.get(Og+Qg))&&Sg(f,k,h,l,g)}for(const n of c.ka())Tg(a,e,...n);(e=c.aa)&&Ug(a,b.get(e),c.bc,!c.yd(),d)});a.F.clear();a.G.clear();Vg(a)}function Yf(a,b){let c=a.F.get(b);void 0===c&&(c=new olympe.dc.db.mh(b),a.F.set(b,c));return c}
586
586
  function Sg(a,b,...c){b.forEach((d,e)=>{Xf(a,e,d.bind(null,...c))})}function Tg(a,b,c,d,e,f){var g=b.get(Og+d+c);g&&Sg(a,g,f,e);(g=b.get(Og+Pg))&&Sg(a,g,c,d,f,e);Wg(a,c,d).forEach((h,k)=>{(k=b.get(Og+Ng+k))&&Sg(a,k,c,d,h,f,e)})}function Ug(a,b,c,d,e){Rg.forEach(f=>{(f=b.get(Og+Ng+f))&&Sg(a,f,c,null,!0,d,e)})}function Vg(a){a.T.run(()=>{const b=a.C;for(const [c,d]of a.buffer){let e,f,g;null==(e=b.get(c))||null==(g=(f=e)[d])||g.call(f)}});a.C.clear();a.buffer.length=0}
587
- function Wg(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.J.get(b);e=new Map;Rg.forEach(g=>{const h=g[0]===olympe.dc.Oe.lh;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(Mg+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===Lg?12:3)&k&&e.set(g,!!((c===Lg?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.et=class{constructor(a,b){this.J=a;this.T=b;this.F=new Map;this.O=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function bg(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.kf.C.tn:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.kf.C.hv:a.G=!0,a.run()}}
588
- olympe.dc.db.kf=class{constructor(a,b,c,d){this.H=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.kf.C.ml&&this.init()}run(){const a=this.C;this.H.debug('Start garbage collector with',this.F.size,'instances to check');const b=[];for(const c of this.F){const d=a.get(c);!d||0<d.c||(this.H.debug('Remove unused instance',c,'from database'),a.Td(c),b.push(c))}this.F.clear();this.C.Fa(olympe.dc.db.Database.C.Ro,b);this.G=!1}init(){const a=olympe.dc.db.Database.C.dr,b=olympe.dc.db.Database.C.np,
589
- c=olympe.dc.db.Database.C.uq,d=olympe.dc.db.Database.G.IDLE,e=f=>{this.F.add(f);this.C.getState()===d&&bg(this)};this.C.C(olympe.dc.db.Database.C.tm,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.addEventListener(olympe.dc.db.Database.C.vv,()=>{this.run()});this.C.C(c,(f,...g)=>{this.H.error(g[0])})}};olympe.dc.db.kf.C={ml:0,hv:1,tn:2};olympe.dc.db.kf.F=5E3;olympe.dc.db.xc=class{constructor(a){this.id=null!=a?a:olympe.Y.zf();this.C=new Map}V(){return this.id}Uc(a){const b=olympe.dc.db.mh.C.Kl,c=olympe.dc.db.mh.C.Cc,d=olympe.dc.db.mh.C.gk;this.C.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.T()?e.Cb():void 0;a.Vc(f,h,k,g);break;case d:e.T()&&a.Qc(f,e.Cb(),g);break;case c:a.F(f,e.J(),g)}for(const [h,k,l]of e.xd())e=this.C.get(k),
590
- l?a.Ha(h,f,k,g,e.Wb()):a.jc(h,f,k,g,e.Wb())})}af(){return 0===this.C.size}O(){let a=0;this.C.forEach(b=>{a+=b.Bc()});return a}Vc(a,b,c,d=null){b=this.J(a).create(b);'string'===typeof d&&this.Ha(olympe.dc.nc.Zc,a,d,d,null);c&&b.Bm(c)}Qc(a,b,c=null){b&&this.J(a,c).Bm(b)}F(a,b=olympe.dc.Ob.NONE,c=null){const d=this.C.get(a);if(d&&d.F())this.G(a,b);else{this.J(a,c).delete(b);for(const e of this.tk(a,b,!1))this.C.get(e).Cb().clear(),this.aa(e,!0)}}Ha(a,b,c,d=null,e=null){this.J(b,d).link(a,c);this.J(c,
591
- e).Ib(a,b)}jc(a,b,c,d=null,e=null){this.J(b,d).unlink(a,c);this.J(c,e).Ub(a,b)}ea(a){var b=olympe.dc.ia();if(b.Ia(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Hg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.Oe.Me}${g}`,f)});this.Vc(a,d,e,c);(b=b.We(a))&&this.Ha(olympe.dc.nc.ei,a,b);e.forEach(f=>{f instanceof olympe.dc.Fc&&this.ea(f.X())})}}bd(){return function*(a){for(const b of a.values())if(b.F()||b.yd()||b.T())yield b}(this.C)}Lc(a){let b;return null!=(b=this.C.get(olympe.dc.ga(a)))?b:null}G(a,
592
- b=olympe.dc.Ob.NONE){a=this.tk(a,b);for(const c of a)this.aa(c,!1),this.C.delete(c)}xd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.xd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Rg(a,b,c=(d,e)=>[d,e]){return this.ua(a,b,c)}*ua(a,b,c,d=[]){d.push(a);a=this.Lc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.ua(e,b,c,d),yield c(e,f))}T(a,b,c){const d=this.C.get(b),e=this.C.get(c);d&&d.O(a,olympe.dc.wa.DESTINATION,c);e&&e.O(a,olympe.dc.wa.ORIGIN,
593
- b)}aa(a,b){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION,e=this.C.get(a);for(const [g,h,k]of e.xd())if(k||!b){e.O(g,d,h);var f=this.C.get(h);f&&f.O(g,c,a)}for(const [g,h,k]of e.kb())if(k||!b)e.O(g,c,h),(f=this.C.get(h))&&f.O(g,d,a)}*Pr(a){let b;for(const [c,d]of(null==(b=this.Lc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.C.get(c),a.yd()||(yield a))}tk(a,b,c=!0){const d=olympe.dm.Relation.C.em,e=olympe.dm.Relation.C.qm,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
594
- const h=new Set;for(const l of a){var k=this.C.get(l);if(void 0!==k){for(const [n,p,q]of k.xd())q&&Eg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.kb())q&&Eg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Ig(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Eg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.C.has(l))}J(a,b){let c=this.C.get(a);void 0===c&&(c=new olympe.dc.db.mh(a),this.C.set(a,c));return b?c.Fa(b):c}Z(a){const b=
595
- olympe.dc.wa.DESTINATION;for(const [c,d]of this.ka(a))if(a=c.tag(),d.yd())this.G(a,d.J());else if(c.yd())d.F()&&this.G(a,c.J());else{c.Cb().forEach((e,f)=>{void 0!==d.Ra(f)&&c.ea(f)});for(const [e,f,g]of c.xd()){const h=d.vb(e,b,f);void 0!==h&&g!==h&&this.T(e,a,f)}}return this}*ka(a){var b=this.C;const c=a.C,d=(a=a.O()>this.O())?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.xc.ya=[olympe.dc.Writable,olympe.dc.Ju];const fg=olympe.dc.db.Database.C,Xg=olympe.dc.db.Database.F.Ai,Yg=olympe.dc.db.Database.F.xt,Zg=olympe.dc.db.Database.F.Me,$g=olympe.dc.db.Database.F.Mk,ah=olympe.dc.db.Database.F.$k,W=olympe.dc.wa.ORIGIN,X=olympe.dc.wa.DESTINATION,bh=olympe.dc.nc.Zc,ch=olympe.dc.nc.ei;function Df(a,b,c=!1){const d=a.get(Zg+b);return c||void 0!==d?d:a.get(Yg+b)}
587
+ function Wg(a,b,c){const d=b+c;let e=a.G.get(d);if(!e){const f=a.K.get(b);e=new Map;Rg.forEach(g=>{const h=g[0]===olympe.dc.Oe.lh;var k=h?g.substring(1):g;let l;k=null!=(l=null==f?void 0:f.get(Mg+k))?l:0;k=h?((k&3)<<2)+((k&12)>>2):k;(c===Lg?12:3)&k&&e.set(g,!!((c===Lg?8:2)&k))});a.G.set(d,e)}return e}olympe.dc.db.ft=class{constructor(a,b){this.K=a;this.T=b;this.F=new Map;this.O=new Set;this.C=new Map;this.G=new Map;this.buffer=[]}};function bg(a){if(!a.G&&0<a.F.size)switch(a.mode){case olympe.dc.db.kf.C.tn:a.G=!0;setTimeout(()=>a.run(),a.delay);break;case olympe.dc.db.kf.C.jv:a.G=!0,a.run()}}
588
+ olympe.dc.db.kf=class{constructor(a,b,c,d){this.H=a;this.C=b;this.F=new Set;this.mode=c;this.delay=d;this.G=!1;c!==olympe.dc.db.kf.C.ml&&this.init()}run(){const a=this.C;this.H.debug('Start garbage collector with',this.F.size,'instances to check');const b=[];for(const c of this.F){const d=a.get(c);!d||0<d.c||(this.H.debug('Remove unused instance',c,'from database'),a.Td(c),b.push(c))}this.F.clear();this.C.Fa(olympe.dc.db.Database.C.Ro,b);this.G=!1}init(){const a=olympe.dc.db.Database.C.er,b=olympe.dc.db.Database.C.op,
589
+ c=olympe.dc.db.Database.C.vq,d=olympe.dc.db.Database.G.IDLE,e=f=>{this.F.add(f);this.C.getState()===d&&bg(this)};this.C.C(olympe.dc.db.Database.C.tm,e.bind(this));this.C.C(b,e.bind(this));this.C.C(a,f=>{this.F.delete(f)});this.C.addEventListener(olympe.dc.db.Database.C.wv,()=>{this.run()});this.C.C(c,(f,...g)=>{this.H.error(g[0])})}};olympe.dc.db.kf.C={ml:0,jv:1,tn:2};olympe.dc.db.kf.F=5E3;olympe.dc.db.uc=class{constructor(a){this.id=null!=a?a:olympe.Y.Af();this.C=new Map}V(){return this.id}Kc(a){const b=olympe.dc.db.mh.C.Kl,c=olympe.dc.db.mh.C.Dc,d=olympe.dc.db.mh.C.gk;this.C.forEach((e,f)=>{const g=e.Wb();switch(e.getState()){case b:const h=e.sb();if(null===h)throw Error(`GraphPatch: try to create the instance ${f} with no source`);const k=e.T()?e.Cb():void 0;a.Vc(f,h,k,g);break;case d:e.T()&&a.Rc(f,e.Cb(),g);break;case c:a.F(f,e.K(),g)}for(const [h,k,l]of e.xd())e=this.C.get(k),
590
+ l?a.Ha(h,f,k,g,e.Wb()):a.jc(h,f,k,g,e.Wb())})}af(){return 0===this.C.size}O(){let a=0;this.C.forEach(b=>{a+=b.Cc()});return a}Vc(a,b,c,d=null){b=this.K(a).create(b);'string'===typeof d&&this.Ha(olympe.dc.nc.Zc,a,d,d,null);c&&b.Bm(c)}Rc(a,b,c=null){b&&this.K(a,c).Bm(b)}F(a,b=olympe.dc.Ob.NONE,c=null){const d=this.C.get(a);if(d&&d.F())this.G(a,b);else{this.K(a,c).delete(b);for(const e of this.tk(a,b,!1))this.C.get(e).Cb().clear(),this.aa(e,!0)}}Ha(a,b,c,d=null,e=null){this.K(b,d).link(a,c);this.K(c,
591
+ e).Ib(a,b)}jc(a,b,c,d=null,e=null){this.K(b,d).unlink(a,c);this.K(c,e).Vb(a,b)}ea(a){var b=olympe.dc.ia();if(b.Ia(a)){const c=b.model(a),d=b.source(a),e=b.Cb(a,!0);Hg(b,a).forEach((f,g)=>{e.set(`${olympe.dc.Oe.Me}${g}`,f)});this.Vc(a,d,e,c);(b=b.We(a))&&this.Ha(olympe.dc.nc.fi,a,b);e.forEach(f=>{f instanceof olympe.dc.vc&&this.ea(f.X())})}}bd(){return function*(a){for(const b of a.values())if(b.F()||b.yd()||b.T())yield b}(this.C)}Mc(a){let b;return null!=(b=this.C.get(olympe.dc.ga(a)))?b:null}G(a,
592
+ b=olympe.dc.Ob.NONE){a=this.tk(a,b);for(const c of a)this.aa(c,!1),this.C.delete(c)}xd(){return function*(a){for(var b=a.next();!b.done;){b=b.value;const c=b.tag();yield*b.xd((d,e,f)=>[d,c,e,f]);b=a.next()}}(this.C.values())}Rg(a,b,c=(d,e)=>[d,e]){return this.ua(a,b,c)}*ua(a,b,c,d=[]){d.push(a);a=this.Mc(a);for(const [e,f]of a.bb(b))d.includes(e)||(yield*this.ua(e,b,c,d),yield c(e,f))}T(a,b,c){const d=this.C.get(b),e=this.C.get(c);d&&d.O(a,olympe.dc.wa.DESTINATION,c);e&&e.O(a,olympe.dc.wa.ORIGIN,
593
+ b)}aa(a,b){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.DESTINATION,e=this.C.get(a);for(const [g,h,k]of e.xd())if(k||!b){e.O(g,d,h);var f=this.C.get(h);f&&f.O(g,c,a)}for(const [g,h,k]of e.kb())if(k||!b)e.O(g,c,h),(f=this.C.get(h))&&f.O(g,d,a)}*Qr(a){let b;for(const [c,d]of(null==(b=this.Mc(a))?void 0:b.bb(olympe.dc.CloudObject.instancesRel))||[])d&&(a=this.C.get(c),a.yd()||(yield a))}tk(a,b,c=!0){const d=olympe.dm.Relation.C.em,e=olympe.dm.Relation.C.qm,f=olympe.dc.wa.ORIGIN,g=olympe.dc.ia();a=new Set([a]);
594
+ const h=new Set;for(const l of a){var k=this.C.get(l);if(void 0!==k){for(const [n,p,q]of k.xd())q&&Eg(g,n,b)&e?a.add(p):c||q||h.add(`${l}.${n}.${p}`);for(const [n,p,q]of k.kb())q&&Eg(g,n,b)&d?a.add(p):c||q||h.add(`${p}.${n}.${l}`)}for(const [n,p,q]of Ig(g,l))k=p===f?d:e,!h.has(p===f?`${q}.${n}.${l}`:`${l}.${n}.${q}`)&&Eg(g,n,b)&k&&a.add(q)}return Array.from(a).filter(l=>this.C.has(l))}K(a,b){let c=this.C.get(a);void 0===c&&(c=new olympe.dc.db.mh(a),this.C.set(a,c));return b?c.Fa(b):c}Z(a){const b=
595
+ olympe.dc.wa.DESTINATION;for(const [c,d]of this.ka(a))if(a=c.tag(),d.yd())this.G(a,d.K());else if(c.yd())d.F()&&this.G(a,c.K());else{c.Cb().forEach((e,f)=>{void 0!==d.Ra(f)&&c.ea(f)});for(const [e,f,g]of c.xd()){const h=d.vb(e,b,f);void 0!==h&&g!==h&&this.T(e,a,f)}}return this}*ka(a){var b=this.C;const c=a.C,d=(a=a.O()>this.O())?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.uc.ya=[olympe.dc.Writable,olympe.dc.Ku];const fg=olympe.dc.db.Database.C,Xg=olympe.dc.db.Database.F.Ai,Yg=olympe.dc.db.Database.F.yt,Zg=olympe.dc.db.Database.F.Me,$g=olympe.dc.db.Database.F.Mk,ah=olympe.dc.db.Database.F.$k,W=olympe.dc.wa.ORIGIN,X=olympe.dc.wa.DESTINATION,bh=olympe.dc.nc.Zc,ch=olympe.dc.nc.fi;function Df(a,b,c=!1){const d=a.get(Zg+b);return c||void 0!==d?d:a.get(Yg+b)}
596
596
  function Rf(a,b){const c=a.model();if(null!==c){if(c===b)return;a.unlink(bh,c)}a.link(bh,b);b.forEach((d,e)=>{if(e[0]===Zg||e[0]===Yg)e=e.substring(1),dh(a,e,d)});null===a.G||!b.e&&b!==a||a.db.aa(a,!0)}function Sf(a,b){const c=a.We();if(null!==c){if(c===b)return;a.unlink(ch,c)}a.link(ch,b);const d=new Map;b.forEach((e,f)=>{if(f[0]===Zg||f[0]===Yg)f=f.substring(1),a.has(Zg+f)||(a.set(Yg+f,e),d.set(f,e))});eh(a,d)}
597
- function Tf(a,b){a.unlink(bh,b);a.forEach((c,d)=>{c=d.substring(1);dh(a,c,null)});a.db.aa(a,!1)}function Uf(a,b){a.unlink(ch,b);const c=new Map;a.forEach((d,e)=>{e[0]===Yg&&(a.delete(e),d=e.substring(1),c.set(d,null))});eh(a,c)}function Vf(a){a.c++;1===a.c&&a.db.F(fg.dr,a.C)}
598
- function Wf(a){0<a.c?--a.c:a.db.F(fg.uq,a.C,`Try to decrease references on instance ${a.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===a.c&&a.db.F(fg.tm,a.C)}
597
+ function Tf(a,b){a.unlink(bh,b);a.forEach((c,d)=>{c=d.substring(1);dh(a,c,null)});a.db.aa(a,!1)}function Uf(a,b){a.unlink(ch,b);const c=new Map;a.forEach((d,e)=>{e[0]===Yg&&(a.delete(e),d=e.substring(1),c.set(d,null))});eh(a,c)}function Vf(a){a.c++;1===a.c&&a.db.F(fg.er,a.C)}
598
+ function Wf(a){0<a.c?--a.c:a.db.F(fg.vq,a.C,`Try to decrease references on instance ${a.C} but the reference counter is already 0.\n`+'It happens when you try to remove a callback from an instance multiple times.\nThis counter reference is used for garbage collection of instances in the database.');0===a.c&&a.db.F(fg.tm,a.C)}
599
599
  function cg(a,b,c){const d=Zg+b;var e=a.get(d);e=void 0===e?null:e;if(!fh(e,c))if(gh(a,b,e,c,!0),e=Yg+b,null===c){a.delete(d);let f;c=null==(f=a.We())?void 0:Df(f,b);c=void 0===c?null:c;null!==c&&a.set(e,c);eh(a,(new Map).set(b,c))}else void 0!==a.get(e)&&a.delete(e),a.set(d,c),eh(a,(new Map).set(b,c))}function ug(a,b,c,d){const e=hh(a,ah+b);return e.has(c)?!1:(e.set(c,d),Vf(a),a.db.F(fg.Vn,a.C,b,c),!0)}function sg(a,b,c){const d=ih(a,ah+b,c);void 0!==d&&(Wf(a),a.db.F(fg.Wn,a.C,b,c));return d}
600
600
  function Ag(a,b,c,d){const e=(...f)=>{var g=f.length;const h=f[g-2];(g=a.db.get(f[g-1]))&&(h?Vf(g):Wf(g));d(...f)};return ug(a,b,c,e)?e:null}function fh(a,b){return a instanceof Date?b instanceof Date&&a.getTime()===b.getTime():null!==a&&'function'===typeof a.Ga?a.Ga(b):a===b}
601
- function gh(a,b,c,d,e){c instanceof olympe.dc.Fc&&(jh(a.db.get(c.X())),a.db.ua(c.X()));d instanceof olympe.dc.Fc&&(c=a.db.G(d.X(),!0),c.F&&c.F.tag!==a.C&&a.db.gb().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.F.tag,'(for the property '+c.F.Ka+')','and is assigned as a property of',a.C,'(for the property '+b+')'),d=c,a=a.C,void 0===d.F&&(Vf(d),d.db.bc(d.C,a,b)),d.F={tag:a,Ka:b,Jx:e})}function kh(a,b,c,d){a.e&&a.db.Mh(a.C,b,c,d)}
601
+ function gh(a,b,c,d,e){c instanceof olympe.dc.vc&&(jh(a.db.get(c.X())),a.db.ua(c.X()));d instanceof olympe.dc.vc&&(c=a.db.G(d.X(),!0),c.F&&c.F.tag!==a.C&&a.db.hb().fatal('Instance',d.X(),'referenced multiple times!\nThis instance is currently property of',c.F.tag,'(for the property '+c.F.Ka+')','and is assigned as a property of',a.C,'(for the property '+b+')'),d=c,a=a.C,void 0===d.F&&(Vf(d),d.db.bc(d.C,a,b)),d.F={tag:a,Ka:b,Kx:e})}function kh(a,b,c,d){a.e&&a.db.Nh(a.C,b,c,d)}
602
602
  function eh(a,b,c=[]){const d=a.get(W+bh);void 0!==d&&d.forEach(e=>{b.forEach((f,g)=>dh(e,g,f))});a=a.get(W+ch);void 0!==a&&a.forEach((e,f)=>{if(!c.includes(e.tag())){var g=new Map;b.forEach((h,k)=>{e.has(Zg+k)||(g.set(k,h),null!==h?e.set(Yg+k,h):e.delete(Yg+k))});eh(e,g,[...c,f])}})}function hh(a,b){let c=a.get(b);void 0===c&&(c=new Map,a.set(b,c));return c}function lh(a,b,c,d,e){a.db.yk(a.C,b,c,d.C,e)}
603
603
  function ih(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 dh(a,b,c){if(!a.has(Xg+b)){const d=$g+b,e=a.get(d);fh(c,void 0!==e?e:null)||(null===c?a.delete(d):a.set(d,c),kh(a,b,c,null!==c))}}function dg(a){a.forEach((b,c)=>{const d=c[0];if(d===W||d===X){const e=c.substring(1),f=d===W?X:W;b.forEach(g=>{g.e&&(lh(a,e,d,g,!0),lh(g,e,f,a,!0))})}else if(d===Xg||d===$g)c=c.substring(1),kh(a,c,b,d===$g)})}
604
- function eg(a){a.forEach((b,c)=>{const d=c[0];if(d!==ah){var e=c.substring(1);d===W?b.forEach(f=>{f.unlink(e,a)}):d===X?b.forEach(f=>{a.unlink(e,f)}):d===Xg?a.update(e,null):d===Zg&&cg(a,e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag),c=a.F.Jx;let d,e;(null==(d=b.get(`${c?Zg:Xg}${a.F.Ka}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.C&&(c?cg(b,a.F.Ka,null):b.update(a.F.Ka,null))}}function jh(a){void 0!==a.F&&(Wf(a),a.db.bc(a.C,a.F.tag,a.F.Ka),a.F=void 0)}
605
- olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ia(){return this.e}J(){return this.db.J(this.C)}source(){return this.G}model(){const a=this.get(X+bh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}We(){const a=this.get(X+ch);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ra(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
604
+ function eg(a){a.forEach((b,c)=>{const d=c[0];if(d!==ah){var e=c.substring(1);d===W?b.forEach(f=>{f.unlink(e,a)}):d===X?b.forEach(f=>{a.unlink(e,f)}):d===Xg?a.update(e,null):d===Zg&&cg(a,e,null);a.delete(c)}});if(void 0!==a.F){const b=a.db.get(a.F.tag),c=a.F.Kx;let d,e;(null==(d=b.get(`${c?Zg:Xg}${a.F.Ka}`))?void 0:null==(e=d.X)?void 0:e.call(d))===a.C&&(c?cg(b,a.F.Ka,null):b.update(a.F.Ka,null))}}function jh(a){void 0!==a.F&&(Wf(a),a.db.bc(a.C,a.F.tag,a.F.Ka),a.F=void 0)}
605
+ olympe.dc.db.Instance=class extends Map{constructor(a,b){super();this.C=a;this.G=null;this.e=!1;this.F=void 0;this.c=0;this.O=!1;this.db=b}tag(){return this.C}Ia(){return this.e}K(){return this.db.K(this.C)}source(){return this.G}model(){const a=this.get(X+bh);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}We(){const a=this.get(X+ch);let b;return null!=(b=a&&Array.from(a.values())[0])?b:null}toString(){var a=this.Ra(olympe.dc.CloudObject.nameProp.X());a=`Instance: ${this.C}, Exist: ${this.e}, Name: ${a}`;
606
606
  var b=this.model();if(b){var c=b.Ra(olympe.dc.CloudObject.nameProp.X())||'No model name';a+=`\nModel: ${b.C}, Exist: ${b.e}, Model name: ${c}`}else a+='\nModel: no model';(b=this.We())?(c=b.Ra(olympe.dc.CloudObject.nameProp.X())||'No extension name',a+=`\nExtension: ${b.C}, Exist: ${b.e}, Extension name: ${c}`):a+='\nExtension: no extension';return a}Ra(a,b=!1){const c=this.get(Xg+a);return b||void 0!==c?c:this.get($g+a)}update(a,b){const c=Xg+a;var d=this.get(c);d=void 0===d?null:d;if(!fh(d,b))if(gh(this,
607
607
  a,d,b,!1),d=$g+a,null===b){this.delete(c);let e;b=null==(e=this.model())?void 0:Df(e,a);void 0!==b?(this.set(d,b),kh(this,a,b,!0)):kh(this,a,null,!1)}else this.set(c,b),this.delete(d),kh(this,a,b,!1)}link(a,b){var c=W+a;const d=hh(this,X+a);c=hh(b,c);d.has(b.C)||(d.set(b.C,b),c.set(this.C,this),this.db.F(fg.Tj,this.C,a,X,b.C),this.db.F(fg.Tj,b.C,a,W,this.C),this.e&&b.e&&(lh(this,a,X,b,!0),lh(b,a,W,this,!0)))}unlink(a,b){const c=W+a;void 0!==ih(this,X+a,b.C)&&(ih(b,c,this.C),this.db.F(fg.bm,this.C,
608
- a,X,b.C),this.db.F(fg.bm,b.C,a,W,this.C),this.e&&b.e&&(lh(this,a,X,b,!1),lh(b,a,W,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===W||c===X){const d=b.substring(1),e=c===W?X:W;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===Xg&&a instanceof olympe.dc.Fc&&jh(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(Xg+this.F.Ka)}};olympe.dc.db.Instance.C={sA:'instance',lB:'rel',$k:'cb',am:'ref',TRANSACTION:'tx'};olympe.dc.db.mh=class a{constructor(b){this.hc=b;this.Z=this.ab=null;this.Pb=olympe.dc.Ob.NONE;this.G=a.C.gk;this.C=this.pb=this.bc=this.aa=this.properties=null}tag(){return this.hc}Wb(){return this.Z}sb(){return this.ab}getState(){return this.G}Fa(b){if(null===this.Z)this.Z=b;else if(this.Z!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Z}`);return this}J(){return this.G===a.C.Cc?this.Pb:olympe.dc.Ob.NONE}create(b){this.G=a.C.Kl;this.ab=null!=
609
- b?b:null;return this}delete(b=olympe.dc.Ob.NONE){this.G=a.C.Cc;this.Pb=b;this.properties=null;return this}la(b,c){if(this.G===a.C.Cc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Bm(b){this.G!==a.C.Cc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}ad(b,c){if(null!==this.aa&&this.aa!==b)throw Error('An instance should never be set as complex property of multiple instances');this.aa=b;this.bc=c}ea(b){let c;null==
610
- (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Zc&&this.Fa(c);this.ra(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Zc&&this.Fa(c);this.ra(this.pb,b,c,!1);return this}Ib(b,c){null===this.C&&(this.C=new Map);this.ra(this.C,b,c,!0)}Ub(b,c){null===this.C&&(this.C=new Map);this.ra(this.C,b,c,!1)}vb(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)return(b=c.get(b))&&
611
- b.get(d)}O(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}F(){return this.G===a.C.Kl}yd(){return this.G===a.C.Cc}Bc(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}T(){return null!==this.properties}Tc(){return null!==this.pb||null!==this.C}Cb(){let b;return null!=(b=this.properties)?b:new Map}Ra(b){if(this.properties)return this.properties.get(b)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
608
+ a,X,b.C),this.db.F(fg.bm,b.C,a,W,this.C),this.e&&b.e&&(lh(this,a,X,b,!1),lh(b,a,W,this,!1)))}persist(){this.O=!0;return this}clear(){this.forEach((a,b)=>{const c=b[0];if(c===W||c===X){const d=b.substring(1),e=c===W?X:W;a.forEach(f=>{const g=f.get(e+d);g.delete(this.C);0===g.size&&f.delete(e+d)})}c===Xg&&a instanceof olympe.dc.vc&&jh(this.db.get(a.X()))});void 0!==this.F&&this.db.get(this.F.tag).delete(Xg+this.F.Ka)}};olympe.dc.db.Instance.C={tA:'instance',mB:'rel',$k:'cb',am:'ref',TRANSACTION:'tx'};olympe.dc.db.mh=class a{constructor(b){this.hc=b;this.Z=this.ab=null;this.Pb=olympe.dc.Ob.NONE;this.G=a.C.gk;this.C=this.pb=this.bc=this.aa=this.properties=null}tag(){return this.hc}Wb(){return this.Z}sb(){return this.ab}getState(){return this.G}Fa(b){if(null===this.Z)this.Z=b;else if(this.Z!==b)throw Error(`Try to set a model relation with another model ${b} than the one set initially ${this.Z}`);return this}K(){return this.G===a.C.Dc?this.Pb:olympe.dc.Ob.NONE}create(b){this.G=a.C.Kl;this.ab=null!=
609
+ b?b:null;return this}delete(b=olympe.dc.Ob.NONE){this.G=a.C.Dc;this.Pb=b;this.properties=null;return this}la(b,c){if(this.G===a.C.Dc)return this;this.properties||(this.properties=new Map);this.properties.set(b,c);return this}Bm(b){this.G!==a.C.Dc&&(this.properties||(this.properties=new Map),b.forEach((c,d)=>{this.properties.set(d,c)}))}ad(b,c){if(null!==this.aa&&this.aa!==b)throw Error('An instance should never be set as complex property of multiple instances');this.aa=b;this.bc=c}ea(b){let c;null==
610
+ (c=this.properties)||c.delete(b);0===this.properties.size&&(this.properties=null)}link(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Zc&&this.Fa(c);this.ra(this.pb,b,c,!0);return this}unlink(b,c){null===this.pb&&(this.pb=new Map);b===olympe.dc.nc.Zc&&this.Fa(c);this.ra(this.pb,b,c,!1);return this}Ib(b,c){null===this.C&&(this.C=new Map);this.ra(this.C,b,c,!0)}Vb(b,c){null===this.C&&(this.C=new Map);this.ra(this.C,b,c,!1)}vb(b,c,d){if(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)return(b=c.get(b))&&
611
+ b.get(d)}O(b,c,d){const e=(c=c===olympe.dc.wa.ORIGIN?this.C:this.pb)&&c.get(b);e&&e.delete(d);e&&0===e.size&&c.delete(b)}F(){return this.G===a.C.Kl}yd(){return this.G===a.C.Dc}Cc(){let b=this.properties?this.properties.size:0,c;null==(c=this.pb)||c.forEach(d=>{b+=d.size});return b}T(){return null!==this.properties}Uc(){return null!==this.pb||null!==this.C}Cb(){let b;return null!=(b=this.properties)?b:new Map}Ra(b){if(this.properties)return this.properties.get(b)}bb(b,c=(d,e)=>[d,e]){return function*(d){if(d=
612
612
  d&&d.get(b.X()))for(const [e,f]of d)yield c(e,f)}(b.Ja()===olympe.dc.wa.ORIGIN?this.C:this.pb)}Jb(b){const c=b.Ja()===olympe.dc.wa.ORIGIN?this.C:this.pb;return(b=c&&c.get(b.X()))&&0!==b.size?Array.from(b.keys())[0]:null}xd(b=(c,d,e)=>[c,d,e]){return this.ua(this.pb,b)}kb(b=(c,d,e)=>[c,d,e]){return this.ua(this.C,b)}ka(b=(c,d,e,f)=>[c,d,e,f]){const c=olympe.dc.wa.ORIGIN,d=olympe.dc.wa.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),
613
- this.pb,this.C)}ra(b,c,d,e){if(this.G!==a.C.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.mh.C={Kl:0,gk:1,Cc:2};olympe.dc.db.tu=class{constructor(a,b,c,d){this.H=a;this.view=b;this.C=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ga(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.F.Ai+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
614
- ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.C.Co,b=olympe.dc.db.Database.C.ol,c=olympe.dc.db.Database.C.Cc,d=olympe.dc.db.Database.C.Tj,e=olympe.dc.db.Database.C.bm,f=olympe.dc.db.Database.C.Vn,g=olympe.dc.db.Database.C.Wn,h=()=>{};this.C.C(olympe.dc.db.Database.C.Bo,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.vb(()=>{Bg(this.view,
615
- k,h,`monitorRelations${k}`)})});this.C.C(c,k=>{this.C.vb(()=>{Cg(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.nr=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.ia=c;this.G=d;this.J=e}write(a){if(this.G){const b=new mh(this.ia);a.Uc(b);this.H.info(b.flush())}this.C.yf();a.Uc(this);this.C.De()}Vc(a,b,c){this.C.create(a,b,c,this.J)}Qc(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Ob.NONE){for(const c of Cf(this.ia,a,b))this.C.ua(c)}Ha(a,b,c){this.C.link(a,b,c)}jc(a,b,c){this.C.unlink(a,b,c)}};
616
- function nh(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.Fc||f instanceof olympe.dc.CloudObject)d+='Reference("'+f.X()+'")';else if(f instanceof olympe.D.Color)d+='Color("'+f.Sg()+','+f.Pg()+','+f.Mg()+','+f.Lg()+'")';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+=nh(a,f,
613
+ this.pb,this.C)}ra(b,c,d,e){if(this.G!==a.C.Dc||!e){var f=b.get(c);if(void 0===f)f=new Map,b.set(c,f);else if(b=f.get(d),void 0!==b&&b!==e){f.delete(d);return}f.set(d,e)}}*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.mh.C={Kl:0,gk:1,Dc:2};olympe.dc.db.uu=class{constructor(a,b,c,d){this.H=a;this.view=b;this.C=c;(this.active=d.get('active'))&&this.init()}debug(a){const b=olympe.dc.ga(a);if(this.C.has(b)){var c=this.C.get(a);a='\n[DEBUG - DATABASE]\n'+c.toString();if(!c.Ia()){const d=[];for(;null!==c&&!d.includes(c.tag());)d.push(c.tag()),c=c.model();c=this.C.get(d[d.length-1]);const e=olympe.dc.db.Database.F.Ai+olympe.dc.CloudObject.nameProp.X();d.push('???');a+='\n\nThe instance <<'+b+'>> does not exists because the instance '+c.tag()+
614
+ ' (name: '+c.get(e)+') has no model.\nList: '+d.join(' --M--\x3e ')}this.H.info(a)}else this.H.info('[DATABASE] Instance',b,'has never been created or referred by the database')}init(){const a=olympe.dc.db.Database.C.Co,b=olympe.dc.db.Database.C.ol,c=olympe.dc.db.Database.C.Dc,d=olympe.dc.db.Database.C.Tj,e=olympe.dc.db.Database.C.bm,f=olympe.dc.db.Database.C.Vn,g=olympe.dc.db.Database.C.Wn,h=()=>{};this.C.C(olympe.dc.db.Database.C.Bo,()=>{});this.C.C(a,()=>{});this.C.C(b,k=>{this.C.vb(()=>{Bg(this.view,
615
+ k,h,`monitorRelations${k}`)})});this.C.C(c,k=>{this.C.vb(()=>{Cg(this.view,k,`monitorRelations${k}`)})});this.C.C(d,()=>{});this.C.C(e,()=>{});this.C.C(f,()=>{});this.C.C(g,()=>{})}};olympe.dc.db.qr=class{constructor(a,b,c,d,e){this.H=a;this.C=b;this.ia=c;this.G=d;this.K=e}write(a){if(this.G){const b=new mh(this.ia);a.Kc(b);this.H.info(b.flush())}this.C.zf();a.Kc(this);this.C.De()}Vc(a,b,c){this.C.create(a,b,c,this.K)}Rc(a,b){this.C.update(a,b)}F(a,b=olympe.dc.Ob.NONE){for(const c of Cf(this.ia,a,b))this.C.ua(c)}Ha(a,b,c){this.C.link(a,b,c)}jc(a,b,c){this.C.unlink(a,b,c)}};
616
+ function nh(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.D.Color)d+='Color("'+f.Sg()+','+f.Pg()+','+f.Mg()+','+f.Lg()+'")';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+=nh(a,f,
617
617
  (null!=(g=c)?g:0)+1)}return'{'+(d?d:'')+'}'}function oh(a,b){let c;return'string'===typeof b?null!=(c=a.db.name(b))?c:b:''}function ph(a,b){let c;return b===olympe.dc.nc.Zc?'Model':null!=(c=a.db.name(b))?c:b}
618
- class mh{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}`:''}`}Vc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${nh(this,c)})`,oh(this,d))}Qc(a,b,c){this.log(`updateInstance(tag: ${a}, ${nh(this,b)})`,oh(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,oh(this,c))}Ha(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ph(this,a))}jc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
619
- ph(this,a))}}olympe.dc.db.nr.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={Ca:'dc.db.Logger',sl:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',rj:'dc.db.Database',il:'dc.db.DBView',mA:'dc.db.Graph',nz:'dc.db.DatabaseWriter',aB:'dc.db.PermissionProcessor',si:'dc.db.GraphMonitor'};olympe.dc.db.U={So:'db.garbageCollector',To:'db.garbageCollectorDelay',bl:'db.commitBufferTimeout',si:'db.monitor',su:'db.monitorCounters',ru:'db.monitorCallbacks',ro:'db.debug'};
620
- olympe.W.config(function(a){F(a,olympe.dc.db.U.So,olympe.dc.db.kf.C.tn);F(a,olympe.dc.db.U.To,5E3);F(a,olympe.dc.db.U.bl,3E4);F(a,olympe.dc.db.U.si,!1);F(a,olympe.dc.db.U.ro,!1);E(a,olympe.dc.db.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('db'));E(a,olympe.dc.db.R.sl,[olympe.ma.R.Ea],b=>b.Wc('gc'));E(a,olympe.dc.db.R.rj,[olympe.dc.db.R.Ca,olympe.dc.db.R.sl,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.db.U.So),new olympe.W.ja(olympe.dc.db.U.To),new olympe.W.ja(olympe.dc.U.zh),new olympe.W.ja(olympe.dc.db.U.ro)],
621
- (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.kf.C.ml:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.R.il,olympe.dc.lb,olympe.dc.db.R.Ca,olympe.dc.db.R.rj);E(a,olympe.dc.db.R.si,[olympe.dc.db.R.Ea],b=>b.Vx);E(a,olympe.dc.db.R.Ea,[olympe.dc.db.R.Ca,olympe.dc.db.R.rj,olympe.dc.db.R.il,new olympe.W.ja(olympe.dc.U.Mf),new olympe.W.ja(olympe.dc.db.U.bl),new olympe.W.ja(olympe.dc.db.U.si),new olympe.W.ja(olympe.dc.db.U.su),
622
- new olympe.W.ja(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.$s(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.R.rj,olympe.dc.db.R.si],(a,b)=>{olympe.ke().db=a;olympe.ke().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function qh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
623
- olympe.dc.query.gf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.C=a;this.Ka=b;this.oi=c}ha(){return{p:this.Ka.X(),o:this.oi}}toString(){return'sortByQueryPart-'+this.oi+this.Ka.X()}Ng(){const a=this.db.Jb(this.Ka,olympe.dm.Property.typeRel),b=olympe.dc.ga;if(this.db.Ef(a,olympe.dm.String))return qh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return qh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return qh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return qh((c,
624
- d)=>c.compare(d));olympe.ma.gb('dc.query').warn(`No comparator found for type with tag ${a}`);return qh(()=>-1)}Ra(){return this.Ka}};olympe.dc.Ne=class{X(){}};olympe.dc.Ne.prototype.getTag=olympe.dc.Ne.prototype.X;olympe.dc.pA=olympe.dc.Ne;function rh(a){let b;if(null==(b=a.C)?0:b.af())if(a=a.J,!a.O){let c;null==(c=a.T)||c.call(a)}}function sh(a,b,c,d,e){rh(a);let f,g;b?null==(f=a.C)||f.Ha(c,d,e):null==(g=a.C)||g.jc(c,d,e)}
625
- olympe.dc.query.xu=class{constructor(a,b,c,d){this.H=a;this.source=b;this.F=c;this.J=d;this.C=this.G=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.F}:${a}:notif`;af(this.db,a,(d,e)=>{if(d){rh(this);let f;null==(f=this.C)||f.ea(e)}else if(b&&yg(this.db,e,c),!this.db.Ia(e)){rh(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Ob.NONE)}},c);b&&xg(this.db,a,(d,e,f)=>{rh(this);let g;f||null!=(g=this.C)&&g.Qc(a,new Map([[d,e]]))},c)}}stop(a){Ze(this.db,a,`${this.F}:${a}:notif`)}};olympe.dc.query.Nj={ASC:'ASC',DESC:'DESC'};function th(a){const b=uh(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].V():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),l=new Set(k.bd()),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.F(y)){let A;n.set(z,Array.from(x).map(B=>p?`${y};${B}`:B).reduce((B,O)=>B.add(O),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.F(x)){let A;n.set(z,
618
+ class mh{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}`:''}`}Vc(a,b,c,d){this.log(`createInstance(tag: ${a}, source: ${b}, ${nh(this,c)})`,oh(this,d))}Rc(a,b,c){this.log(`updateInstance(tag: ${a}, ${nh(this,b)})`,oh(this,c))}F(a,b,c){this.log(`deleteInstance("${a}", rule: ${b})`,oh(this,c))}Ha(a,b,c){this.log(`createRelation("${a}", "${b}", "${c}")`,ph(this,a))}jc(a,b,c){this.log(`deleteRelation("${a}", "${b}", "${c}")`,
619
+ ph(this,a))}}olympe.dc.db.qr.ya=[olympe.dc.Writable,olympe.dc.Writable];olympe.dc.db.R={Ca:'dc.db.Logger',sl:'dc.db.gc.Logger',Ea:'dc.db.DatabaseManager',rj:'dc.db.Database',il:'dc.db.DBView',nA:'dc.db.Graph',oz:'dc.db.DatabaseWriter',bB:'dc.db.PermissionProcessor',ti:'dc.db.GraphMonitor'};olympe.dc.db.U={So:'db.garbageCollector',To:'db.garbageCollectorDelay',bl:'db.commitBufferTimeout',ti:'db.monitor',tu:'db.monitorCounters',su:'db.monitorCallbacks',ro:'db.debug'};
620
+ olympe.W.config(function(a){F(a,olympe.dc.db.U.So,olympe.dc.db.kf.C.tn);F(a,olympe.dc.db.U.To,5E3);F(a,olympe.dc.db.U.bl,3E4);F(a,olympe.dc.db.U.ti,!1);F(a,olympe.dc.db.U.ro,!1);E(a,olympe.dc.db.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('db'));E(a,olympe.dc.db.R.sl,[olympe.ma.R.Ea],b=>b.Wc('gc'));E(a,olympe.dc.db.R.rj,[olympe.dc.db.R.Ca,olympe.dc.db.R.sl,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.db.U.So),new olympe.W.ja(olympe.dc.db.U.To),new olympe.W.ja(olympe.dc.U.Ah),new olympe.W.ja(olympe.dc.db.U.ro)],
621
+ (b,c,d,e,f,g,h)=>{e=g?olympe.dc.db.kf.C.ml:e;d=(new Map).set('selfTag',d).set('garbageCollector',e).set('garbageCollectorDelay',f).set('debug',h);return new olympe.dc.db.Database(b,c,d)});D(a,olympe.dc.db.R.il,olympe.dc.lb,olympe.dc.db.R.Ca,olympe.dc.db.R.rj);E(a,olympe.dc.db.R.ti,[olympe.dc.db.R.Ea],b=>b.Wx);E(a,olympe.dc.db.R.Ea,[olympe.dc.db.R.Ca,olympe.dc.db.R.rj,olympe.dc.db.R.il,new olympe.W.ja(olympe.dc.U.Nf),new olympe.W.ja(olympe.dc.db.U.bl),new olympe.W.ja(olympe.dc.db.U.ti),new olympe.W.ja(olympe.dc.db.U.tu),
622
+ new olympe.W.ja(olympe.dc.db.U.su)],(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.at(b,c,d,e,g)})},'olympe.dc.db');olympe.W.run([olympe.dc.db.R.rj,olympe.dc.db.R.ti],(a,b)=>{olympe.je().db=a;olympe.je().dbMonitor=b},'DC.DB debug service injection');olympe.dc.query={};function qh(a){return(b,c)=>{const d=null===b,e=null===c;return d||e?d&&e?0:d?1:-1:a(b,c)}}
623
+ olympe.dc.query.gf=class{constructor(a,b,c){this.db=olympe.dc.ia();this.C=a;this.Ka=b;this.ri=c}ha(){return{p:this.Ka.X(),o:this.ri}}toString(){return'sortByQueryPart-'+this.ri+this.Ka.X()}Ng(){const a=this.db.Jb(this.Ka,olympe.dm.Property.typeRel),b=olympe.dc.ga;if(this.db.Ff(a,olympe.dm.String))return qh((c,d)=>c.localeCompare(d));if(a===b(olympe.dm.Number)||a===b(olympe.dm.Boolean))return qh((c,d)=>c-d);if(a===b(olympe.dm.DateTime))return qh((c,d)=>c.getTime()-d.getTime());if(a===b(olympe.dm.Color))return qh((c,
624
+ d)=>c.compare(d));olympe.ma.hb('dc.query').warn(`No comparator found for type with tag ${a}`);return qh(()=>-1)}Ra(){return this.Ka}};olympe.dc.Ne=class{X(){}};olympe.dc.Ne.prototype.getTag=olympe.dc.Ne.prototype.X;olympe.dc.qA=olympe.dc.Ne;function rh(a){let b;if(null==(b=a.C)?0:b.af())if(a=a.K,!a.O){let c;null==(c=a.T)||c.call(a)}}function sh(a,b,c,d,e){rh(a);let f,g;b?null==(f=a.C)||f.Ha(c,d,e):null==(g=a.C)||g.jc(c,d,e)}
625
+ olympe.dc.query.yu=class{constructor(a,b,c,d){this.H=a;this.source=b;this.F=c;this.K=d;this.C=this.G=null;this.db=olympe.dc.ia()}watch(a,b){if(this.db.source(a)===this.source){var c=`${this.F}:${a}:notif`;af(this.db,a,(d,e)=>{if(d){rh(this);let f;null==(f=this.C)||f.ea(e)}else if(b&&yg(this.db,e,c),!this.db.Ia(e)){rh(this);let f;null==(f=this.C)||f.F(e,olympe.dc.Ob.NONE)}},c);b&&xg(this.db,a,(d,e,f)=>{rh(this);let g;f||null!=(g=this.C)&&g.Rc(a,new Map([[d,e]]))},c)}}stop(a){Ze(this.db,a,`${this.F}:${a}:notif`)}};olympe.dc.query.Nj={ASC:'ASC',DESC:'DESC'};function th(a){const b=uh(a.query),c=new Map;for(let e=b.length;0<=e;e--){const f=0<e?b[e-1].V():a.G,g=0<e?b[e-1].C:'root',h=0<e&&b[e-1].T(),k=a.C.get(f),l=new Set(k.bd()),n=new Map,p=a.K.has(f);let q=p?';':'';if(c.has(f)){const [r,t,u]=c.get(f);c.delete(f);q+=u;r.forEach((x,y)=>{for(const z of k.F(y)){let A;n.set(z,Array.from(x).map(B=>p?`${y};${B}`:B).reduce((B,O)=>B.add(O),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.F(x)){let A;n.set(z,
626
626
  (null!=(A=n.get(z))?A:new Set).add(y))}})}else l.forEach(r=>{const t=p?`${r};`:'';for(const u of k.F(r))n.has(u)?n.get(u).add(t):n.set(u,(new Set).add(t))});if(0<e&&c.has(g)){const [r,t,u]=c.get(g),x=new Map;n.forEach((y,z)=>{let A;null==(A=r.get(z))||A.forEach(B=>{let O;const M=null!=(O=x.get(z))?O:new Set;y.forEach(xa=>M.add(xa+B));x.set(z,M)});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].T()&&r.forEach((y,z)=>{x.set(z,new Set(Array.from(y).map(A=>
627
- 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 vh(a){if(null===a.F){const b={Fb:a.query.Ng(),Ed:a.Ed,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Pa.from(a.Z,th(a),b)}return a.F}function wh(a,b){a.T=b}function xh(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
628
- function yh(a,b){let c;return null!=(c=a.C.get(b).bd())?c:[]}function zh(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Ah(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.H.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&xh(a);let g;f&&(null==(g=a.Ge)||g.watch(b,a.J.has(c)));return f}function Bh(a,b,c,d,e,f){null!==a.Ge&&(d===olympe.dc.wa.ORIGIN?sh(a.Ge,b,c,f,e):sh(a.Ge,b,c,e,f))}
629
- function Ch(a){a.H.C()&&a.H.debug(`Start sending notifications for query ${a.query.V()}`);const b=new olympe.dc.query.xu(a.H,a.query.sb(),a.query.V(),a);a.C.forEach((c,d)=>{for(const e of c.bd())b.watch(e,a.J.has(d))});null!=b.C||(b.C=new olympe.dc.db.xc);a.Ge=b}function Dh(a){null!==a.Ge&&(a.H.C()&&a.H.debug(`Stop sending notifications for query ${a.query.V()}`),a.C.forEach(b=>{for(const c of b.bd())a.Ge.stop(c)}),a.Ge=null)}
630
- function Eh(a){a.O=!1;if(null!=(a=a.Ge)){let b;const c=!(null==(b=a.C)?0:b.af());a.G=c?a.C:null;c&&(a.C=new olympe.dc.db.xc,a.H.C()&&a.H.debug(`Commit notification with ${a.G.O()} operations for query ${a.F}`))}}
631
- olympe.dc.query.lq=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.xb(b.F);this.ta=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ta.hm);this.J=new Set(b.J);this.Ed=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Pa.empty();this.Ge=this.F=null;a=uh(b);a.forEach(c=>{const d=c.V();this.ta.set(d,c.O());this.C.set(d,c.ua())});b=b.Ng();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.V())))if(c+=this.J.has(d)?1:0,b===d){this.Ed=c;break}}}remove(a,b=this.G,c='root'){b=
632
- this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&xh(this);if(!b.has(a)){let d;null==(d=this.Ge)||d.stop(a);return!0}return!1}Kc(a){const b=a.F,c=olympe.Y.xb(b);a=uh(a);const d=[];for(const [f,g]of this.C){if(g.O(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.aa(k,this.ta.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ta.get(k))?void 0:l.Kc(f))?n:!1});e.set(f.V(),h);return 0<h.length})}};function Fh(a){if(!olympe.dc.ia().Rb(a,olympe.dm.Property))throw new olympe.dc.query.Kd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
633
- function Gh(a){var b=olympe.dc.query.Aa.C.$q;const c=olympe.dc.query.Aa.C.Do,d=olympe.dc.query.Aa.C.pj,e=olympe.dc.query.Aa.C.kp,f=olympe.dc.query.Aa.C.Mp,g=olympe.dc.query.Aa.C.wq,h=olympe.dc.query.Aa.C.rn,k=olympe.dc.query.Aa.C.Zp;switch(a.pr){case b:return new olympe.dc.query.$.om(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.te(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.$.hf(a.p,
634
- a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.$.li(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.ce(Gh(a.v));case g:return new olympe.dc.query.$.rf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.$.xe(...a.p.map(l=>Gh(l)));case h:return new olympe.dc.query.$.Fd(...a.p.map(l=>Gh(l)));default:return null}}
635
- olympe.dc.query.Aa=class{observe(){}ob(){}compile(){return[[this]]}pd(){return new olympe.dc.query.$.ce(this)}Cb(){}Kc(){}clear(){}ha(){}Pc(){}toString(){}Ga(a){return this===a}static Dx(...a){return new olympe.dc.query.$.om(a)}static Ga(a,b){Fh(a);return new olympe.dc.query.$.te(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Fh(a);return new olympe.dc.query.$.hf(a,b,olympe.dc.ia(),c)}static wy(a,b,c=!0){Fh(a);return new olympe.dc.query.$.rf(a,b,olympe.dc.ia(),c)}static xk(a,b,c=!0){Fh(a);return new olympe.dc.query.$.li(olympe.dc.ia(),
636
- a,b,!1,c)}static gj(a,b,c=!0){Fh(a);return new olympe.dc.query.$.li(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.Kd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.$.Fd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Kd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
637
- return new olympe.dc.query.$.xe(...a)}static pd(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Kd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.$.ce(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.pd;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.gj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.xk;
638
- olympe.dc.query.Aa.regex=olympe.dc.query.Aa.wy;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ga;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Dx;olympe.dc.query.Aa.C={$q:0,Do:1,pj:2,kp:3,Mp:4,wq:5,Zp:6,rn:7};function uh(a){return Array.from(a.ta)}
639
- function Hh(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.wa.ORIGIN?e:d);if(0>a.G)e=a.C.He;else if(e=a.ta[a.G],null!==e.ka)e=e.ka;else{var f=olympe.dc.wa.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ja()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(null===d||!a.db.Ef(d,e)&&!a.db.Ef(e,d))throw new olympe.dc.query.Kd(`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=
640
- b.V();for(c=a.G+1;c<a.ta.length&&a.ta[c].V()!==d;)c++;b=c<a.ta.length?a.ta:a.ta.concat(b);return new olympe.dc.pa(a.F,a.source,b,c,a.J,a.C)}function Ih(a,b=a.G){return 0<=b?a.ta[b].V():olympe.Y.xb(a.F)}function Jh(a,b,c,d={}){var e=olympe.dc.Ob.Uf;const f=(null==d?0:d.Od)?d.Od:olympe.dc.pa.$c.Lf;d=(null==d?0:d.kn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);const g=olympe.dc.Xd().Ee(b);b=(new olympe.dc.pa(b,g)).ge();b.ta=[new olympe.dc.query.ta.Rd(Ih(b),e,c)];return b.observe(a,{Od:f,lk:d})}
641
- function Kh(a){const b=0===a.J.size?a.ge():a;if(null!==b.C.Ed&&!b.J.has(Ih(a,b.C.Ed)))throw new olympe.dc.query.Kd('AndReturn was not called for the current level before sortBy operator');return b}
642
- olympe.dc.pa=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ed:null,He:null}){this.db=olympe.dc.ia();this.F=a;this.source=b;this.ta=c;this.G=d;this.J=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ga(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Kd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Xd().Ee(a);b=new olympe.dc.pa(a,b);b.C.He=olympe.dc.ia().model(a);return b}static Ee(a,
643
- b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Kd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.Xd().fromModel(b);c=new olympe.dc.pa(a,c);c.C.He=olympe.dc.ga(b);return c}static Bk(a,b=!0,c){const d=olympe.dc.ga(a);var e=olympe.dc.ia();if(!e.Sh(d))throw new olympe.dc.query.Kd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);a=null!=c?c:olympe.dc.Xd().fromModel(d);
644
- a=new olympe.dc.pa(d,a);a.C.He=e.model(d);b&&(a=Hh(a,new olympe.dc.query.ta.ue(Ih(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ta.kh(Ih(a),olympe.dc.CloudObject.instancesRel,!1);e.ka=d;return Hh(b,e)}static Pb(a,b,c,d,e){const f=(null==e?0:e.Od)?e.Od:olympe.dc.pa.$c.Lf;e=(null==e?0:e.kn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);d=null!=d?d:olympe.dc.Xd().Ee(b);d=(new olympe.dc.pa(b,d)).ge();d.ta=[new olympe.dc.query.ta.Rd(Ih(d),c)];return d.observe(a,{Od:f,lk:e})}fb(a,
645
- b=!1){if(!(a instanceof olympe.dc.Na.Relation))throw new olympe.dc.query.Kd(`The relation given to follow() is invalid: ${a}`);return Hh(this,new olympe.dc.query.ta.kh(Ih(this),a,b))}ag(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Na.Relation))throw new olympe.dc.query.Kd(`The relation given to followRecursively() is invalid: ${a}`);return Hh(this,new olympe.dc.query.ta.ue(Ih(this),a,b,c))}ge(){const a=(new Set(this.J)).add(Ih(this));return new olympe.dc.pa(this.F,this.source,this.ta,this.G,a,this.C)}filter(a){if(!(a instanceof
646
- olympe.dc.query.Aa))throw new olympe.dc.query.Kd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ta);b[this.G]=b[this.G].filter(a);return new olympe.dc.pa(this.F,this.source,b,this.G,this.J,this.C)}Pi(){return this}aj(a,b=0){return new olympe.dc.pa(this.F,this.source,this.ta,this.G,this.J,{Ed:this.C.Ed,max:a,offset:b,He:this.C.He})}Jk(a,b=olympe.dc.query.Nj.ASC){if(0>this.G)throw new olympe.dc.query.Kd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');
647
- if(!olympe.dc.ia().Rb(a,olympe.dm.Property))throw new olympe.dc.query.Kd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ta[this.G],d={Ed:this.G,max:this.C.max,offset:this.C.offset,He:this.C.He},e=Array.from(this.ta);e[this.G]=c.sort(a,b);return new olympe.dc.pa(this.F,this.source,e,this.G,this.J,d)}Ng(){const a=this.C.Ed;let b;return null!==a?null==(b=this.ta[a])?void 0:b.Ng():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=
648
- this.ta[b].C;for(b--;-1<b&&Ih(this,b)!==d;)b--}return new olympe.dc.pa(this.F,this.source,Array.from(this.ta),b,this.J,this.C)}parse(){const a=new Map,b=Ih(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.J.has(b),filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.Sh(this.F)?c.dataType=olympe.dc.ga(this.F):(c.root=olympe.dc.ga(this.F),c.dataType=this.C.He);this.ta.forEach((d,e)=>{const f=d.V(),g=d.Pc();Object.assign(g,{returned:this.J.has(f),next:[]});a.set(f,g);g.sort&&
649
- this.C.Ed!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ta.kh&&d.relation.Ga(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ta.ue&&d.relation.Ga(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.Od)?a.Od:olympe.dc.pa.$c.Xl;let c;return olympe.dc.query.wk().executeQuery(Kh(this),b,{Ih:null!=(c=null==a?void 0:a.lk)?c:null==a?void 0:
650
- a.cacheId,yc:null==a?void 0:a.yc}).then(d=>{let e;return null!=(e=null==d?void 0:vh(d))?e:olympe.dc.Pa.empty()})}nd(){return vh(Lh(olympe.dc.query.wk(),Kh(this)))}observe(a,b){const c=(null==b?0:b.Od)?b.Od:olympe.dc.pa.$c.Lf;a='function'===typeof a.F?a.F():a;let d;return Mh(olympe.dc.query.wk(),Kh(this),a,olympe.dc.Qa.SELF,c,{Ih:null!=(d=null==b?void 0:b.lk)?d:null==b?void 0:b.cacheId,yc:null==b?void 0:b.yc}).pipe(rxjs.operators.map(e=>vh(e)),rxjs.operators.distinctUntilChanged())}V(){null===this.id&&
651
- (this.id=olympe.Y.xb(this.F+uh(this).map(a=>a.J()).join()+Array.from(new Set(this.J)).sort().toString()+this.C.Ed+this.C.max+this.C.offset));return this.id}sb(){return this.source}ha(){let a;return{b:this.F,p:this.ta.map(b=>b.ha()),r:Array.from(this.J),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.Ed,rm:null!=(a=this.C.He)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ia(this.F)?olympe.dc.CloudObject.get(this.F):this.F,relations:this.ta.map(a=>
627
+ 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 vh(a){if(null===a.F){const b={Gb:a.query.Ng(),Ed:a.Ed,max:a.query.C.max,offset:a.query.C.offset};a.F=olympe.dc.Pa.from(a.Z,th(a),b)}return a.F}function wh(a,b){a.T=b}function xh(a){if(!a.O){null!==a.F&&(a.Z=a.F);a.F=null;a.O=!0;let b;null==(b=a.T)||b.call(a)}}
628
+ function yh(a,b){let c;return null!=(c=a.C.get(b).bd())?c:[]}function zh(a,b,c){let d,e;return null!=(e=null==(d=a.C.get(c))?void 0:d.has(b))?e:!1}function Ah(a,b,c=a.G,d='root'){const e=a.C.get(c);if(!e)return a.H.error('Try to insert result entry to a higher level than possible'),null;const f=!e.has(b);e.G(b,d)&&xh(a);let g;f&&(null==(g=a.Ge)||g.watch(b,a.K.has(c)));return f}function Bh(a,b,c,d,e,f){null!==a.Ge&&(d===olympe.dc.wa.ORIGIN?sh(a.Ge,b,c,f,e):sh(a.Ge,b,c,e,f))}
629
+ function Ch(a){a.H.C()&&a.H.debug(`Start sending notifications for query ${a.query.V()}`);const b=new olympe.dc.query.yu(a.H,a.query.sb(),a.query.V(),a);a.C.forEach((c,d)=>{for(const e of c.bd())b.watch(e,a.K.has(d))});null!=b.C||(b.C=new olympe.dc.db.uc);a.Ge=b}function Dh(a){null!==a.Ge&&(a.H.C()&&a.H.debug(`Stop sending notifications for query ${a.query.V()}`),a.C.forEach(b=>{for(const c of b.bd())a.Ge.stop(c)}),a.Ge=null)}
630
+ function Eh(a){a.O=!1;if(null!=(a=a.Ge)){let b;const c=!(null==(b=a.C)?0:b.af());a.G=c?a.C:null;c&&(a.C=new olympe.dc.db.uc,a.H.C()&&a.H.debug(`Commit notification with ${a.G.O()} operations for query ${a.F}`))}}
631
+ olympe.dc.query.mq=class{constructor(a,b){this.H=a;this.query=b;this.G=olympe.Y.xb(b.F);this.ta=new Map;this.C=(new Map).set(this.G,new olympe.dc.query.ta.hm);this.K=new Set(b.K);this.Ed=-1;this.O=!1;this.T=null;this.Z=olympe.dc.Pa.empty();this.Ge=this.F=null;a=uh(b);a.forEach(c=>{const d=c.V();this.ta.set(d,c.O());this.C.set(d,c.ua())});b=b.Ng();if(null!==b){b=b.C;let c=-1;for(const d of[this.G].concat(a.map(e=>e.V())))if(c+=this.K.has(d)?1:0,b===d){this.Ed=c;break}}}remove(a,b=this.G,c='root'){b=
632
+ this.C.get(b);if(null==b||!b.has(a))return!0;b.remove(a,c)&&xh(this);if(!b.has(a)){let d;null==(d=this.Ge)||d.stop(a);return!0}return!1}Lc(a){const b=a.F,c=olympe.Y.xb(b);a=uh(a);const d=[];for(const [f,g]of this.C){if(g.O(b))return!0;g.has(b)&&d.push(f)}const e=(new Map).set(c,d);return 0<d.length&&a.every(f=>{let g;const h=(null!=(g=e.get(f.C))?g:[]).flatMap(k=>f.aa(k,this.ta.get(k))).filter(k=>{let l,n;return null!=(n=null==(l=this.ta.get(k))?void 0:l.Lc(f))?n:!1});e.set(f.V(),h);return 0<h.length})}};function Fh(a){if(!olympe.dc.ia().Sb(a,olympe.dm.Property))throw new olympe.dc.query.Kd(`The specified property while trying to build a query predicate is invalid: ${a}`);}
633
+ function Gh(a){var b=olympe.dc.query.Aa.C.ar;const c=olympe.dc.query.Aa.C.Do,d=olympe.dc.query.Aa.C.pj,e=olympe.dc.query.Aa.C.lp,f=olympe.dc.query.Aa.C.Np,g=olympe.dc.query.Aa.C.xq,h=olympe.dc.query.Aa.C.rn,k=olympe.dc.query.Aa.C.$p;switch(a.pr){case b:return new olympe.dc.query.$.om(a.t);case c:b=a.v;switch(a.t){case 2:b=new Date(b);break;case 3:b=olympe.dc.CloudObject.get(b);break;case 4:b=olympe.D.Color.create(b.r,b.g,b.b,b.a)}return new olympe.dc.query.$.se(a.p,b,olympe.dc.ia());case d:return new olympe.dc.query.$.hf(a.p,
634
+ a.s,olympe.dc.ia(),a.c);case e:return new olympe.dc.query.$.mi(olympe.dc.ia(),a.p,a.b,a.l,a.s);case f:return new olympe.dc.query.$.ce(Gh(a.v));case g:return new olympe.dc.query.$.sf(a.p,new RegExp(a.r),olympe.dc.ia(),a.c);case k:return new olympe.dc.query.$.we(...a.p.map(l=>Gh(l)));case h:return new olympe.dc.query.$.Fd(...a.p.map(l=>Gh(l)));default:return null}}
635
+ olympe.dc.query.Aa=class{observe(){}ob(){}compile(){return[[this]]}pd(){return new olympe.dc.query.$.ce(this)}Cb(){}Lc(){}clear(){}ha(){}Qc(){}toString(){}Ga(a){return this===a}static Ex(...a){return new olympe.dc.query.$.om(a)}static Ga(a,b){Fh(a);return new olympe.dc.query.$.se(a,b,olympe.dc.ia())}static contains(a,b,c=!0){Fh(a);return new olympe.dc.query.$.hf(a,b,olympe.dc.ia(),c)}static xy(a,b,c=!0){Fh(a);return new olympe.dc.query.$.sf(a,b,olympe.dc.ia(),c)}static xk(a,b,c=!0){Fh(a);return new olympe.dc.query.$.mi(olympe.dc.ia(),
636
+ a,b,!1,c)}static gj(a,b,c=!0){Fh(a);return new olympe.dc.query.$.mi(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.Kd(`Some specified predicates, while trying to build an AND query predicate are invalid: ${a}`);return new olympe.dc.query.$.Fd(...a)}static or(...a){if(!a.every(b=>b instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Kd(`Some specified predicates, while trying to build an OR query predicate are invalid: ${a}`);
637
+ return new olympe.dc.query.$.we(...a)}static pd(a){if(!(a instanceof olympe.dc.query.Aa))throw new olympe.dc.query.Kd(`The specified predicate, while trying to build a NOT query predicate is invalid: ${a}`);return new olympe.dc.query.$.ce(a)}};olympe.dc.query.Aa.not=olympe.dc.query.Aa.pd;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.gj;olympe.dc.query.Aa.greaterThan=olympe.dc.query.Aa.xk;
638
+ olympe.dc.query.Aa.regex=olympe.dc.query.Aa.xy;olympe.dc.query.Aa.contains=olympe.dc.query.Aa.contains;olympe.dc.query.Aa.equals=olympe.dc.query.Aa.Ga;olympe.dc.query.Aa['in']=olympe.dc.query.Aa.Ex;olympe.dc.query.Aa.C={ar:0,Do:1,pj:2,lp:3,Np:4,xq:5,$p:6,rn:7};function uh(a){return Array.from(a.ta)}
639
+ function Hh(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.wa.ORIGIN?e:d);if(0>a.G)e=a.C.He;else if(e=a.ta[a.G],null!==e.ka)e=e.ka;else{var f=olympe.dc.wa.ORIGIN;e=olympe.dc.ia().Jb(e.relation,e.relation.Ja()===f?olympe.dm.Relation.originModelRel:olympe.dm.Relation.destinationModelRel)}if(null===d||!a.db.Ff(d,e)&&!a.db.Ff(e,d))throw new olympe.dc.query.Kd(`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=
640
+ b.V();for(c=a.G+1;c<a.ta.length&&a.ta[c].V()!==d;)c++;b=c<a.ta.length?a.ta:a.ta.concat(b);return new olympe.dc.pa(a.F,a.source,b,c,a.K,a.C)}function Ih(a,b=a.G){return 0<=b?a.ta[b].V():olympe.Y.xb(a.F)}function Jh(a,b,c,d={}){var e=olympe.dc.Ob.Uf;const f=(null==d?0:d.Od)?d.Od:olympe.dc.pa.$c.Mf;d=(null==d?0:d.kn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);const g=olympe.dc.Xd().Ee(b);b=(new olympe.dc.pa(b,g)).fe();b.ta=[new olympe.dc.query.ta.Rd(Ih(b),e,c)];return b.observe(a,{Od:f,lk:d})}
641
+ function Kh(a){const b=0===a.K.size?a.fe():a;if(null!==b.C.Ed&&!b.K.has(Ih(a,b.C.Ed)))throw new olympe.dc.query.Kd('AndReturn was not called for the current level before sortBy operator');return b}
642
+ olympe.dc.pa=class{constructor(a,b,c=[],d=-1,e=new Set,f={max:-1,offset:0,Ed:null,He:null}){this.db=olympe.dc.ia();this.F=a;this.source=b;this.ta=c;this.G=d;this.K=e;this.C=f;this.id=null}static from(a,b){a=olympe.dc.ga(a);if(!olympe.dc.CloudObject.exists(a))throw new olympe.dc.query.Kd(`Try to create a query from an instance that does not exist (${a}). Please try to use \`Query.fromTag()\` instead.`);b=null!=b?b:olympe.dc.Xd().Ee(a);b=new olympe.dc.pa(a,b);b.C.He=olympe.dc.ia().model(a);return b}static Ee(a,
643
+ b,c){if(!olympe.dc.CloudObject.exists(b))throw new olympe.dc.query.Kd(`Try to create a query from an instance (${a}) with an explicit datatype that does not exist (${b})`);a=olympe.dc.ga(a);c=null!=c?c:olympe.dc.Xd().fromModel(b);c=new olympe.dc.pa(a,c);c.C.He=olympe.dc.ga(b);return c}static Bk(a,b=!0,c){const d=olympe.dc.ga(a);var e=olympe.dc.ia();if(!e.Th(d))throw new olympe.dc.query.Kd(`Try to create a query to get instances of ${a}, which is not a data type or does not exist.`);a=null!=c?c:olympe.dc.Xd().fromModel(d);
644
+ a=new olympe.dc.pa(d,a);a.C.He=e.model(d);b&&(a=Hh(a,new olympe.dc.query.ta.te(Ih(a),olympe.dc.CloudObject.extendedByRel,!0,!1)));b=a;e=new olympe.dc.query.ta.kh(Ih(a),olympe.dc.CloudObject.instancesRel,!1);e.ka=d;return Hh(b,e)}static Pb(a,b,c,d,e){const f=(null==e?0:e.Od)?e.Od:olympe.dc.pa.$c.Mf;e=(null==e?0:e.kn)?'__code-as-data__':void 0;b=olympe.dc.ga(b);d=null!=d?d:olympe.dc.Xd().Ee(b);d=(new olympe.dc.pa(b,d)).fe();d.ta=[new olympe.dc.query.ta.Rd(Ih(d),c)];return d.observe(a,{Od:f,lk:e})}gb(a,
645
+ b=!1){if(!(a instanceof olympe.dc.Na.Relation))throw new olympe.dc.query.Kd(`The relation given to follow() is invalid: ${a}`);return Hh(this,new olympe.dc.query.ta.kh(Ih(this),a,b))}ag(a,b=!1,c=!1){if(!(a instanceof olympe.dc.Na.Relation))throw new olympe.dc.query.Kd(`The relation given to followRecursively() is invalid: ${a}`);return Hh(this,new olympe.dc.query.ta.te(Ih(this),a,b,c))}fe(){const a=(new Set(this.K)).add(Ih(this));return new olympe.dc.pa(this.F,this.source,this.ta,this.G,a,this.C)}filter(a){if(!(a instanceof
646
+ olympe.dc.query.Aa))throw new olympe.dc.query.Kd(`The specified predicate while trying to filter a query is invalid: ${a}`);const b=Array.from(this.ta);b[this.G]=b[this.G].filter(a);return new olympe.dc.pa(this.F,this.source,b,this.G,this.K,this.C)}Pi(){return this}aj(a,b=0){return new olympe.dc.pa(this.F,this.source,this.ta,this.G,this.K,{Ed:this.C.Ed,max:a,offset:b,He:this.C.He})}Jk(a,b=olympe.dc.query.Nj.ASC){if(0>this.G)throw new olympe.dc.query.Kd('You are trying to sort an empty query. Please first follow at least one relation to sort a query.');
647
+ if(!olympe.dc.ia().Sb(a,olympe.dm.Property))throw new olympe.dc.query.Kd(`The specified property while trying to sort a query is invalid: ${a}`);const c=this.ta[this.G],d={Ed:this.G,max:this.C.max,offset:this.C.offset,He:this.C.He},e=Array.from(this.ta);e[this.G]=c.sort(a,b);return new olympe.dc.pa(this.F,this.source,e,this.G,this.K,d)}Ng(){const a=this.C.Ed;let b;return null!==a?null==(b=this.ta[a])?void 0:b.Ng():null}back(a=1){if(0>this.G||1>a)return this;let b=this.G;for(let c=0;c<a;c++){const d=
648
+ this.ta[b].C;for(b--;-1<b&&Ih(this,b)!==d;)b--}return new olympe.dc.pa(this.F,this.source,Array.from(this.ta),b,this.K,this.C)}parse(){const a=new Map,b=Ih(this,-1),c={limit:this.C.max,offset:this.C.offset,returned:this.K.has(b),filter:[],optional:!1,inheritance:!1,next:[]};a.set(b,c);this.db.Th(this.F)?c.dataType=olympe.dc.ga(this.F):(c.root=olympe.dc.ga(this.F),c.dataType=this.C.He);this.ta.forEach((d,e)=>{const f=d.V(),g=d.Qc();Object.assign(g,{returned:this.K.has(f),next:[]});a.set(f,g);g.sort&&
649
+ this.C.Ed!==e&&delete g.sort;if(1>=e&&d instanceof olympe.dc.query.ta.kh&&d.relation.Ga(olympe.dc.CloudObject.instancesRel))Object.assign(c,g);else if(0===e&&d instanceof olympe.dc.query.ta.te&&d.relation.Ga(olympe.dc.CloudObject.extendedByRel))Object.assign(c,g),c.inheritance=!0;else{let h;null==(h=a.get(d.C))||h.next.push(g)}});return c}ob(a){const b=(null==a?0:a.Od)?a.Od:olympe.dc.pa.$c.Xl;let c;return olympe.dc.query.wk().executeQuery(Kh(this),b,{Jh:null!=(c=null==a?void 0:a.lk)?c:null==a?void 0:
650
+ a.cacheId,zc:null==a?void 0:a.zc}).then(d=>{let e;return null!=(e=null==d?void 0:vh(d))?e:olympe.dc.Pa.empty()})}nd(){return vh(Lh(olympe.dc.query.wk(),Kh(this)))}observe(a,b){const c=(null==b?0:b.Od)?b.Od:olympe.dc.pa.$c.Mf;a='function'===typeof a.F?a.F():a;let d;return Mh(olympe.dc.query.wk(),Kh(this),a,olympe.dc.Qa.SELF,c,{Jh:null!=(d=null==b?void 0:b.lk)?d:null==b?void 0:b.cacheId,zc:null==b?void 0:b.zc}).pipe(rxjs.operators.map(e=>vh(e)),rxjs.operators.distinctUntilChanged())}V(){null===this.id&&
651
+ (this.id=olympe.Y.xb(this.F+uh(this).map(a=>a.K()).join()+Array.from(new Set(this.K)).sort().toString()+this.C.Ed+this.C.max+this.C.offset));return this.id}sb(){return this.source}ha(){let a;return{b:this.F,p:this.ta.map(b=>b.ha()),r:Array.from(this.K),s:this.source,e:{m:this.C.max,o:this.C.offset,s:this.C.Ed,rm:null!=(a=this.C.He)?a:this.db.model(this.F)}}}toString(){return`Query: ${JSON.stringify(this)}`}toJSON(){return{origin:this.db.Ia(this.F)?olympe.dc.CloudObject.get(this.F):this.F,relations:this.ta.map(a=>
652
652
  a.toJSON())}}};olympe.dc.pa.prototype.observe=olympe.dc.pa.prototype.observe;olympe.dc.pa.prototype.executeFromCache=olympe.dc.pa.prototype.nd;olympe.dc.pa.prototype.execute=olympe.dc.pa.prototype.ob;olympe.dc.pa.prototype.parse=olympe.dc.pa.prototype.parse;olympe.dc.pa.prototype.back=olympe.dc.pa.prototype.back;olympe.dc.pa.prototype.sortBy=olympe.dc.pa.prototype.Jk;olympe.dc.pa.prototype.limit=olympe.dc.pa.prototype.aj;olympe.dc.pa.prototype.cast=olympe.dc.pa.prototype.Pi;
653
- olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.ge;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.ag;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.fb;olympe.dc.pa.followRule=olympe.dc.pa.Pb;olympe.dc.pa.instancesOf=olympe.dc.pa.Bk;olympe.dc.pa.fromTag=olympe.dc.pa.Ee;olympe.dc.pa.from=olympe.dc.pa.from;olympe.dc.pa.$c={Lf:1,Xl:2,Yl:3};olympe.dc.pa.C={Yk:'cacheBucketName',qp:'isCacheable'};olympe.dc.query.td=class extends olympe.dc.hh{constructor(a,b){super(a,null);this.source=b}static Ti(a){const b=new olympe.dc.db.xc(`DataResult_${a.V()}`);return new olympe.dc.query.td(b,a.sb())}static C(a){const b=(new olympe.dc.transaction.zi(a.s)).C(a.p);return new olympe.dc.query.td(b,a.s)}create(a,b,c){this.C.Vc(a,this.source,c,b);return this}Ha(a,b,c){this.C.Ha(a,b,c,null,null);return this}ha(){const a=new olympe.dc.transaction.Tf;this.C.Uc(a);return{s:this.source,p:nf(a)}}};
654
- olympe.dc.query.td.prototype.createRelation=olympe.dc.query.td.prototype.Ha;olympe.dc.query.td.prototype.create=olympe.dc.query.td.prototype.create;olympe.dc.query.td.fromQuery=olympe.dc.query.td.Ti;function Lh(a,b){const c=new olympe.dc.query.lq(a.H,b);if(a.F.view.Ia(b.F)){Ah(c,b.F);for(const d of uh(b))d.ob(c)}return c}
655
- function Mh(a,b,c,d,e,f){const g=b.V();let h=a.C.get(g);if(!h){var k=b.sb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.yc||a.J&&k===olympe.dc.Qa.SERVER?[]:Array.from(a.C.values());h=new olympe.dc.query.tq(a.H,a.F,b,a.T.bind(a,e,f));a.C.set(g,h);Nh(h,l=>a.G.add(l));h.start(k)&&(null==f?0:f.Ih)&&Oh(a,b,e,f).catch(l=>{a.H.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=>
656
- {const n=()=>{p&&c.De(p);l.complete();if(q){var r=q;const u=a.C.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.J.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.V()}, now have ${t.J.size} subscribers`);d!==olympe.dc.Qa.SELF&&(t.Z--,0===t.Z&&Dh(t.C));r=0===t.J.size}r&&(a.H.debug(`No more subscriber to ${g}, remove the subscription`),a.G.delete(g),a.C.delete(g),u.destroy())}},p=c.Z(n),q=Ph(h,d,l);return n})}
657
- function Qh(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Rh(c)});a.G.clear()}function Sh(a,b){var c=b.V();b=a.O.J.has(c)?$e(new olympe.dc.db.xc(b.V()),b.F):b;a.F.wc(b)}function Th(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.qg,olympe.dc.Qa.SERVER);return a.Yb.request(b).then(c=>{a.F.wc(c)})}
658
- function Uh(a,b){const c=b.sb();if(c===olympe.dc.Qa.SELF||a.J&&c===olympe.dc.Qa.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.Kc(b)).map(d=>new Promise(e=>d.Bd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Oh(a,b,c,d){return v(function*(){var e=b.sb();e=ef(ef(new olympe.dc.Request(olympe.dc.Request.C.yg,e,b),olympe.dc.pa.C.qp,c===olympe.dc.pa.$c.Yl),olympe.dc.pa.C.Yk,null==d?void 0:d.Ih);return a.Yb.request(e)})}
659
- function Vh(a,b,c){const d=[];for(const e of a.C.values())Wh(e,b,c)&&d.push(Oh(a,e.query,olympe.dc.pa.$c.Xl,{}).then(f=>{a.F.wc(f)}));return Promise.all(d).then(()=>{})}
660
- olympe.dc.query.Pu=class{constructor(a,b,c,d,e){this.H=a;this.F=b;this.O=c;this.Yb=d;this.J=e;this.C=new Map;this.G=new Set;hg(b,()=>Qh(this));lf(d,olympe.dc.Request.C.lo,f=>{Sh(this,f.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e='boolean'===typeof c.yc?c.yc:yield Uh(d,a);if(!e||(null==c?0:c.Ih))try{const f=yield Oh(d,a,b,c);e||d.F.wc(f)}catch(f){return d.H.error(`Error while sending a query to data source ${a.sb()}: ${f}`),null}return Lh(d,a)})}T(a,b,c,d,e){const f=c.sb();
661
- if(f===olympe.dc.Qa.SELF||b.yc||this.J&&f===olympe.dc.Qa.SERVER)return d(),null;if(a!==olympe.dc.pa.$c.Lf)return Oh(this,c,a,b).then(q=>{this.F.wc(q);d()}).catch(e),null;let g,h=!1;const k=q=>{g=[];q&&this.H.debug(`Resend subscription ${c.V()} after detection of dead subscription in the remote service`);Oh(this,c,a,b).then(r=>{if(h)this.H.warn(`Received data result after query subscription ${c.V()} has been destroyed. Could happen with queries observed multiple times successively quickly.`);else{this.F.wc(r);
662
- let t;null==(t=g)||t.forEach(u=>Sh(this,u));g=null}d()}).catch(e)},l=c.V();k(!1);const n=ef(new olympe.dc.Request(olympe.dc.Request.C.Rj,f,c),olympe.dc.pa.C.Yk,null==b?void 0:b.Ih),p=kf(this.Yb,n,k.bind(this,!0)).pipe(db(olympe.N.errors.bp,()=>{},0)).pipe(db(olympe.N.errors.Rn,(q,r)=>{this.H.debug(`Data Provider: Subscribe to topic ${q.V()} now that we are back online, after waiting for ${r}ms`);k(!0)},0)).subscribe(rxjs.Subscriber.create(q=>{Array.isArray(g)?g.push(q):Sh(this,q)},q=>{this.H.error(`An error occurred with the subscription ${l}: ${q}`);
663
- e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function hf(a){return a.J.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function jf(a){return a.G.map(b=>a.F.get(a.C[b]))}function Xh(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ia(g)?olympe.dc.CloudObject.get(g):(olympe.ma.gb('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.Pa.create(d,a.a,a.r)}
664
- olympe.dc.Pa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.J=[];this.hash=''}static empty(){return new olympe.dc.Pa}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Ie(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ie().includes(a)}indexOf(a){return null===
665
- a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Ie().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Gc(){return this.ie(0)}ie(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Ie();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Ie();a.pop();return a}shift(){if(0<this.C.length){const a=this.Ie();a.shift();return a}return[]}filter(a){return this.Ie().filter(a)}find(a){return(a=this.Ie().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
666
- a(this.F.get(b),c))}map(a){return this.Ie().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Pa.create(b,Array.from(this.G),Array.from(this.J))}reduce(a,b){return this.Ie().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.J.concat(...a.map(d=>d.J));return olympe.dc.Pa.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ie()}static from(a,
667
- b,{Fb:c,Ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.oi===olympe.dc.query.Nj.ASC?1:-1,r=c.Ng(),t=c.Ra();b.sort((u,x)=>{x=x[d];u=p.Ra(u[d],t);x=p.Ra(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.nb.zc(u),olympe.dc.nb.zc(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.xb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?
668
- 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.Pa.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Pa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.xb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.J=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.J}}};olympe.dc.Pa.prototype.concat=olympe.dc.Pa.prototype.concat;
653
+ olympe.dc.pa.prototype.filter=olympe.dc.pa.prototype.filter;olympe.dc.pa.prototype.andReturn=olympe.dc.pa.prototype.fe;olympe.dc.pa.prototype.followRecursively=olympe.dc.pa.prototype.ag;olympe.dc.pa.prototype.follow=olympe.dc.pa.prototype.gb;olympe.dc.pa.followRule=olympe.dc.pa.Pb;olympe.dc.pa.instancesOf=olympe.dc.pa.Bk;olympe.dc.pa.fromTag=olympe.dc.pa.Ee;olympe.dc.pa.from=olympe.dc.pa.from;olympe.dc.pa.$c={Mf:1,Xl:2,Yl:3};olympe.dc.pa.C={Yk:'cacheBucketName',rp:'isCacheable'};olympe.dc.query.td=class extends olympe.dc.hh{constructor(a,b){super(a,null);this.source=b}static Ti(a){const b=new olympe.dc.db.uc(`DataResult_${a.V()}`);return new olympe.dc.query.td(b,a.sb())}static C(a){const b=(new olympe.dc.transaction.th(a.s)).C(a.p);return new olympe.dc.query.td(b,a.s)}create(a,b,c){this.C.Vc(a,this.source,c,b);return this}Ha(a,b,c){this.C.Ha(a,b,c,null,null);return this}ha(){const a=new olympe.dc.transaction.pf;this.C.Kc(a);return{s:this.source,p:nf(a)}}};
654
+ olympe.dc.query.td.prototype.createRelation=olympe.dc.query.td.prototype.Ha;olympe.dc.query.td.prototype.create=olympe.dc.query.td.prototype.create;olympe.dc.query.td.fromQuery=olympe.dc.query.td.Ti;function Lh(a,b){const c=new olympe.dc.query.mq(a.H,b);if(a.F.view.Ia(b.F)){Ah(c,b.F);for(const d of uh(b))d.ob(c)}return c}
655
+ function Mh(a,b,c,d,e,f){const g=b.V();let h=a.C.get(g);if(!h){var k=b.sb();a.H.debug(`Create new subscription for query ${g} for subscriber ${d}, to be executed by the data source ${k}`);k=!1===f.zc||a.K&&k===olympe.dc.Qa.SERVER?[]:Array.from(a.C.values());h=new olympe.dc.query.uq(a.H,a.F,b,a.T.bind(a,e,f));a.C.set(g,h);Nh(h,l=>a.G.add(l));h.start(k)&&(null==f?0:f.Jh)&&Oh(a,b,e,f).catch(l=>{a.H.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=>
656
+ {const n=()=>{p&&c.De(p);l.complete();if(q){var r=q;const u=a.C.get(g);a.H.debug(`${d} unsubscribed from ${g}`);if(null==u)r=0;else{var t=u;t.K.delete(r)&&t.H.debug(`Remove subscriber ${d} for query ${t.query.V()}, now have ${t.K.size} subscribers`);d!==olympe.dc.Qa.SELF&&(t.Z--,0===t.Z&&Dh(t.C));r=0===t.K.size}r&&(a.H.debug(`No more subscriber to ${g}, remove the subscription`),a.G.delete(g),a.C.delete(g),u.destroy())}},p=c.Z(n),q=Ph(h,d,l);return n})}
657
+ function Qh(a){a.G.forEach(b=>{let c;null==(c=a.C.get(b))||Rh(c)});a.G.clear()}function Sh(a,b){var c=b.V();b=a.O.K.has(c)?$e(new olympe.dc.db.uc(b.V()),b.F):b;a.F.yc(b)}function Th(a){a.H.debug('Send GetContext request to the orchestrator');const b=new olympe.dc.Request(olympe.dc.Request.C.qg,olympe.dc.Qa.SERVER);return a.Yb.request(b).then(c=>{a.F.yc(c)})}
658
+ function Uh(a,b){const c=b.sb();if(c===olympe.dc.Qa.SELF||a.K&&c===olympe.dc.Qa.SERVER)return Promise.resolve(!0);a=Array.from(a.C.values()).filter(d=>d.Lc(b)).map(d=>new Promise(e=>d.Bd(f=>e(!f))));return Promise.all(a).then(d=>d.some(e=>e))}function Oh(a,b,c,d){return v(function*(){var e=b.sb();e=ef(ef(new olympe.dc.Request(olympe.dc.Request.C.yg,e,b),olympe.dc.pa.C.rp,c===olympe.dc.pa.$c.Yl),olympe.dc.pa.C.Yk,null==d?void 0:d.Jh);return a.Yb.request(e)})}
659
+ function Vh(a,b,c){const d=[];for(const e of a.C.values())Wh(e,b,c)&&d.push(Oh(a,e.query,olympe.dc.pa.$c.Xl,{}).then(f=>{a.F.yc(f)}));return Promise.all(d).then(()=>{})}
660
+ olympe.dc.query.Qu=class{constructor(a,b,c,d,e){this.H=a;this.F=b;this.O=c;this.Yb=d;this.K=e;this.C=new Map;this.G=new Set;hg(b,()=>Qh(this));lf(d,olympe.dc.Request.C.lo,f=>{Sh(this,f.content)})}executeQuery(a,b,c){const d=this;return v(function*(){const e='boolean'===typeof c.zc?c.zc:yield Uh(d,a);if(!e||(null==c?0:c.Jh))try{const f=yield Oh(d,a,b,c);e||d.F.yc(f)}catch(f){return d.H.error(`Error while sending a query to data source ${a.sb()}: ${f}`),null}return Lh(d,a)})}T(a,b,c,d,e){const f=c.sb();
661
+ if(f===olympe.dc.Qa.SELF||b.zc||this.K&&f===olympe.dc.Qa.SERVER)return d(),null;if(a!==olympe.dc.pa.$c.Mf)return Oh(this,c,a,b).then(q=>{this.F.yc(q);d()}).catch(e),null;let g,h=!1;const k=q=>{g=[];q&&this.H.debug(`Resend subscription ${c.V()} after detection of dead subscription in the remote service`);Oh(this,c,a,b).then(r=>{if(h)this.H.warn(`Received data result after query subscription ${c.V()} has been destroyed. Could happen with queries observed multiple times successively quickly.`);else{this.F.yc(r);
662
+ let t;null==(t=g)||t.forEach(u=>Sh(this,u));g=null}d()}).catch(e)},l=c.V();k(!1);const n=ef(new olympe.dc.Request(olympe.dc.Request.C.Rj,f,c),olympe.dc.pa.C.Yk,null==b?void 0:b.Jh),p=kf(this.Yb,n,k.bind(this,!0)).pipe(db(olympe.N.errors.bp,()=>{},0)).pipe(db(olympe.N.errors.Rn,(q,r)=>{this.H.debug(`Data Provider: Subscribe to topic ${q.V()} now that we are back online, after waiting for ${r}ms`);k(!0)},0)).subscribe(rxjs.Subscriber.create(q=>{Array.isArray(g)?g.push(q):Sh(this,q)},q=>{this.H.error(`An error occurred with the subscription ${l}: ${q}`);
663
+ e(String(q))}));return()=>{h=!0;this.H.debug(`Unsubscribe to query ${l} from data source ${f}`);p.unsubscribe()}}};function hf(a){return a.K.map(b=>{b=b.split('.');return 1===b.length?b[0]:b})}function jf(a){return a.G.map(b=>a.F.get(a.C[b]))}function Xh(a){const b=olympe.dc.ia();let c=!1;const d=a.k.map(e=>{const f=e.split('.').map(g=>b.Ia(g)?olympe.dc.CloudObject.get(g):(olympe.ma.hb('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.Pa.create(d,a.a,a.r)}
664
+ olympe.dc.Pa=class{constructor(){this.C=[];this.F=new Map;this.G=[];this.K=[];this.hash=''}static empty(){return new olympe.dc.Pa}[Symbol.iterator](){let a=0;return{next:()=>{var b={done:!0};a<this.C.length&&(b=this.C[a],b={value:[b,this.F.get(b)],done:!1},a++);return b}}}entries(){return this.C.map(a=>[a,this.F.get(a)])}values(){return this.F.values()}keys(){return this.C.values()}Ie(){return this.C.map(a=>this.F.get(a))}size(){return this.C.length}has(a){return this.F.has(a)||this.Ie().includes(a)}indexOf(a){return null===
665
+ a||void 0===a?-1:'string'===typeof a?this.C.indexOf(a):this.Ie().indexOf(a)}get(a){return(a=this.F.get(a))?a:null}Gc(){return this.he(0)}he(a){return a<this.C.length?this.F.get(this.C[a]):null}push(...a){const b=this.Ie();b.push(...a);return b}pop(){if(0===this.C.length)return[];const a=this.Ie();a.pop();return a}shift(){if(0<this.C.length){const a=this.Ie();a.shift();return a}return[]}filter(a){return this.Ie().filter(a)}find(a){return(a=this.Ie().find(a))?a:null}forEach(a){this.C.forEach((b,c)=>
666
+ a(this.F.get(b),c))}map(a){return this.Ie().map(a)}sort(a){const b=this.entries().sort((c,d)=>a(c[1],d[1]));return olympe.dc.Pa.create(b,Array.from(this.G),Array.from(this.K))}reduce(a,b){return this.Ie().reduce(a,b)}concat(...a){const b=[this.entries(),...a.map(d=>d.entries())].flat();let c=Array.from(this.G);for(const d of a)c=c.concat(d.G.map(e=>e+c.length));a=this.K.concat(...a.map(d=>d.K));return olympe.dc.Pa.create(b,c,a)}toString(){return`QueryResult: ${JSON.stringify(this)}`}toJSON(){return this.Ie()}static from(a,
667
+ b,{Gb:c,Ed:d,offset:e,max:f}={}){if(null!==c&&-1<d){const p=olympe.dc.ia(),q=c.ri===olympe.dc.query.Nj.ASC?1:-1,r=c.Ng(),t=c.Ra();b.sort((u,x)=>{x=x[d];u=p.Ra(u[d],t);x=p.Ra(x,t);return null===u?-q:null===x?q:q*r(olympe.dc.nb.Ac(u),olympe.dc.nb.Ac(x))})}else b.sort((p,q)=>p.reduce((r,t,u)=>r||t.localeCompare(q[u]),0));if(0<e||-1<f)b=b.slice(e,-1<f?e+f:void 0);c=olympe.Y.xb(b.flat().join(''));if(c===a.hash)return a;const g=p=>''===p?null:olympe.dc.CloudObject.get(p);e=b.map(p=>[p.join('.'),1===p.length?
668
+ 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.Pa.create(e,l,n,c)}static create(a,b,c,d){const e=new olympe.dc.Pa;e.C=a.map(f=>f[0]);e.F=new Map(a);e.hash=d||olympe.Y.xb(e.C.join(''));e.G=b||e.C.map((f,g)=>g);e.K=c||[];return e}ha(a){a&&this.C.flatMap(b=>b.split('.')).forEach(a);return{k:this.C,a:this.G,r:this.K}}};olympe.dc.Pa.prototype.concat=olympe.dc.Pa.prototype.concat;
669
669
  olympe.dc.Pa.prototype.reduce=olympe.dc.Pa.prototype.reduce;olympe.dc.Pa.prototype.sort=olympe.dc.Pa.prototype.sort;olympe.dc.Pa.prototype.map=olympe.dc.Pa.prototype.map;olympe.dc.Pa.prototype.forEach=olympe.dc.Pa.prototype.forEach;olympe.dc.Pa.prototype.find=olympe.dc.Pa.prototype.find;olympe.dc.Pa.prototype.filter=olympe.dc.Pa.prototype.filter;olympe.dc.Pa.prototype.shift=olympe.dc.Pa.prototype.shift;olympe.dc.Pa.prototype.pop=olympe.dc.Pa.prototype.pop;olympe.dc.Pa.prototype.push=olympe.dc.Pa.prototype.push;
670
- olympe.dc.Pa.prototype.getAt=olympe.dc.Pa.prototype.ie;olympe.dc.Pa.prototype.getFirst=olympe.dc.Pa.prototype.Gc;olympe.dc.Pa.prototype.get=olympe.dc.Pa.prototype.get;olympe.dc.Pa.prototype.indexOf=olympe.dc.Pa.prototype.indexOf;olympe.dc.Pa.prototype.has=olympe.dc.Pa.prototype.has;olympe.dc.Pa.prototype.size=olympe.dc.Pa.prototype.size;olympe.dc.Pa.prototype.toArray=olympe.dc.Pa.prototype.Ie;olympe.dc.Pa.prototype.keys=olympe.dc.Pa.prototype.keys;olympe.dc.Pa.prototype.values=olympe.dc.Pa.prototype.values;
671
- olympe.dc.Pa.prototype.entries=olympe.dc.Pa.prototype.entries;olympe.dc.Pa.empty=olympe.dc.Pa.empty;function Yh(a){return 1<a.size()?(olympe.ma.gb('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.hd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.hd(olympe.dc.pa.from(a))}fb(a){return new olympe.dc.hd(this.query.fb(a))}Pi(){return this}ob(a){return this.query.ob(a).then(b=>Yh(b))}nd(){return Yh(this.query.nd())}};olympe.dc.hd.prototype.executeFromCache=olympe.dc.hd.prototype.nd;
672
- olympe.dc.hd.prototype.execute=olympe.dc.hd.prototype.ob;olympe.dc.hd.prototype.cast=olympe.dc.hd.prototype.Pi;olympe.dc.hd.prototype.follow=olympe.dc.hd.prototype.fb;const Zh=olympe.dc.wa.ORIGIN,$h=olympe.dc.wa.DESTINATION;function Nh(a,b){wh(a.C,()=>{a.eb()||null!==a.G||b(a.query.V())})}function Ph(a,b,c){const d=a.aa;a.aa++;a.J.set(d,c);b===olympe.dc.Qa.SELF?a.Bd(e=>e?c.error(e):c.next(a.C)):(a.Z++,1===a.Z&&a.Bd(()=>Ch(a.C)));a.H.debug(`Add subscriber ${b} for query ${a.query.V()}, now have ${a.J.size} subscribers`);return d}
673
- function Wh(a,b,c){if(a.query.sb()!==b)return!1;c.Uc(a.ea);(b=a.ea.flush())&&a.H.debug(`Subscription ${a.query.V()} is considered as obsolete after the transaction ${c.V()} applied on DB`);return b}function Rh(a){Eh(a.C);a.J.forEach(b=>{b.next(a.C)})}function ai(a,b,c){const d=[];let e=!1;const f=new olympe.async.Oj(olympe.D.Og());for(const g of b)g.Kc(a.query)&&(e||(e=!0),f.add(h=>g.Bd(k=>{!k&&d.push(g);h()})));Rc(f,g=>c(g?d:[]));f.start();return e}
670
+ olympe.dc.Pa.prototype.getAt=olympe.dc.Pa.prototype.he;olympe.dc.Pa.prototype.getFirst=olympe.dc.Pa.prototype.Gc;olympe.dc.Pa.prototype.get=olympe.dc.Pa.prototype.get;olympe.dc.Pa.prototype.indexOf=olympe.dc.Pa.prototype.indexOf;olympe.dc.Pa.prototype.has=olympe.dc.Pa.prototype.has;olympe.dc.Pa.prototype.size=olympe.dc.Pa.prototype.size;olympe.dc.Pa.prototype.toArray=olympe.dc.Pa.prototype.Ie;olympe.dc.Pa.prototype.keys=olympe.dc.Pa.prototype.keys;olympe.dc.Pa.prototype.values=olympe.dc.Pa.prototype.values;
671
+ olympe.dc.Pa.prototype.entries=olympe.dc.Pa.prototype.entries;olympe.dc.Pa.empty=olympe.dc.Pa.empty;function Yh(a){return 1<a.size()?(olympe.ma.hb('dc').warn(`a follow() on a QuerySingle has ${a.size()} results (0 or 1 expected) -> returns null`),null):a.Gc()||null}olympe.dc.hd=class{constructor(a){this.query=a}static from(a){return new olympe.dc.hd(olympe.dc.pa.from(a))}gb(a){return new olympe.dc.hd(this.query.gb(a))}Pi(){return this}ob(a){return this.query.ob(a).then(b=>Yh(b))}nd(){return Yh(this.query.nd())}};olympe.dc.hd.prototype.executeFromCache=olympe.dc.hd.prototype.nd;
672
+ olympe.dc.hd.prototype.execute=olympe.dc.hd.prototype.ob;olympe.dc.hd.prototype.cast=olympe.dc.hd.prototype.Pi;olympe.dc.hd.prototype.follow=olympe.dc.hd.prototype.gb;const Zh=olympe.dc.wa.ORIGIN,$h=olympe.dc.wa.DESTINATION;function Nh(a,b){wh(a.C,()=>{a.eb()||null!==a.G||b(a.query.V())})}function Ph(a,b,c){const d=a.aa;a.aa++;a.K.set(d,c);b===olympe.dc.Qa.SELF?a.Bd(e=>e?c.error(e):c.next(a.C)):(a.Z++,1===a.Z&&a.Bd(()=>Ch(a.C)));a.H.debug(`Add subscriber ${b} for query ${a.query.V()}, now have ${a.K.size} subscribers`);return d}
673
+ function Wh(a,b,c){if(a.query.sb()!==b)return!1;c.Kc(a.ea);(b=a.ea.flush())&&a.H.debug(`Subscription ${a.query.V()} is considered as obsolete after the transaction ${c.V()} applied on DB`);return b}function Rh(a){Eh(a.C);a.K.forEach(b=>{b.next(a.C)})}function ai(a,b,c){const d=[];let e=!1;const f=new olympe.async.Oj(olympe.D.Og());for(const g of b)g.Lc(a.query)&&(e||(e=!0),f.add(h=>g.Bd(k=>{!k&&d.push(g);h()})));Rc(f,g=>c(g?d:[]));f.start();return e}
674
674
  function bi(a){const b=a.query.V(),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=uh(a.query),f=a.C;for(let q=e.length-1;0<=q;q--){var g=e[q];const r=g.V(),t=g.C;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.F,l=olympe.Y.xb(k),n=af(h,k,(q,r)=>{q?Ah(f,r):f.remove(r);d(l)(q,r,null,b)});let p;null==(p=a.T)||p.push(()=>{Ze(h,k,n)});ci(a)}
675
675
  function di(a){const b=a.ka(a.query,()=>{null===a.G||a.eb()||bi(a)},d=>{a.eb()||(a.H.error(`Error while getting data from data source (${a.query.sb()}) to ensure coverage of the query ${a.query.V()}: ${d}`),ci(a))});let c;b&&(null==(c=a.T)||c.push(b))}function ei(a,b){a.O.delete(b);0===a.O.size&&(a.O=null,Promise.resolve().then(()=>{!a.eb()&&di(a)}))}function ci(a){const b=a.G;a.G=null;null==b||b.forEach(c=>c())}
676
- olympe.dc.query.tq=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.lq(this.H,c);this.Z=0;this.aa=1;this.T=[];this.J=new Map;this.G=[()=>Eh(this.C)];this.ka=d;this.ea=new fi(a,this.db,c,this.C);this.F=this.O=null}start(a){return ai(this,a,b=>{0<b.length?(this.O=new Set(b),this.O.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),bi(this)):di(this)})}Kc(a){return!this.eb()&&this.query.sb()===a.sb()&&(this.query.V()===a.V()||(null===this.G||this.query.F===
677
- a.F)&&this.C.Kc(a))}Bd(a){null!==this.G?this.G.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.V()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.V()}`);const b=this.T;this.T=null;this.J.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>ei(e,this));let d;null==(d=this.O)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}eb(){return null===this.T}};
676
+ olympe.dc.query.uq=class{constructor(a,b,c,d){this.H=a;this.db=b.view;this.query=c;this.C=new olympe.dc.query.mq(this.H,c);this.Z=0;this.aa=1;this.T=[];this.K=new Map;this.G=[()=>Eh(this.C)];this.ka=d;this.ea=new fi(a,this.db,c,this.C);this.F=this.O=null}start(a){return ai(this,a,b=>{0<b.length?(this.O=new Set(b),this.O.forEach(c=>{null===c.F&&(c.F=new Set);c.F.add(this)}),bi(this)):di(this)})}Lc(a){return!this.eb()&&this.query.sb()===a.sb()&&(this.query.V()===a.V()||(null===this.G||this.query.F===
677
+ a.F)&&this.C.Lc(a))}Bd(a){null!==this.G?this.G.push(a):a();return this}destroy(a){a?this.H.error(`Destroy subscription ${this.query.V()} after error: ${a}`):this.H.debug(`Destroy subscription ${this.query.V()}`);const b=this.T;this.T=null;this.K.forEach(e=>a?e.error(a):e.complete());let c;null==(c=this.F)||c.forEach(e=>ei(e,this));let d;null==(d=this.O)||d.forEach(e=>{e.F.delete(this);0===e.F.size&&(e.F=null)});b.forEach(e=>e())}eb(){return null===this.T}};
678
678
  function gi(a,b){return a.G.has($h+b)||a.G.has(Zh+b)}
679
- class fi{constructor(a,b,c,d){this.H=a;this.db=b;this.J=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of uh(c)){a=f.V();this.T.push(a);if(f instanceof olympe.dc.query.ta.wh){a=f.relation;a=`${a.Ja()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}hi(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.V());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=!1;return a}Vc(){}Qc(a,b){if(!(this.C||
680
- !this.O&&this.db.Ia(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&zh(this.J,a,e)))}}F(a){this.C||this.db.Ia(a)&&!this.O||this.C||(this.C=this.T.some(b=>zh(this.J,a,b)))}Ha(a,b,c){if(!this.C&&gi(this,a)){var d=this.db.Ia(b),e=this.db.Ia(c);if(d&&!e||!d&&e){const f=this.G.get($h+a);a=this.G.get(Zh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>zh(this.J,b,g.C)))||e&&(null==a?void 0:a.some(g=>zh(this.J,c,g.C))))}}}jc(a,b,c){if(!this.C&&this.O&&gi(this,a)&&this.db.Xr(b,
681
- new olympe.dc.Na.Relation(a),c)){const d=this.G.get($h+a);a=this.G.get(Zh+a);const e=this.J;this.C||(this.C=(null==d?void 0:d.some(f=>zh(e,b,f.C)&&zh(e,c,f.V())))||(null==a?void 0:a.some(f=>zh(e,c,f.C)&&zh(e,b,f.V()))))}}}olympe.dc.query.tq.ya=[olympe.dc.Writable];function ii(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
682
- olympe.dc.query.Relation=class extends olympe.dc.Na.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 Vb(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.ze)}cc(){const a=
683
- olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}V(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',Qj:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('query'));D(a,olympe.dc.query.R.Qj,olympe.dc.query.Pu,olympe.dc.query.R.Ca,olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.Ag,new olympe.W.ja(olympe.dc.U.zh))});olympe.W.run([olympe.dc.query.R.Qj],a=>{olympe.dc.query.wk=()=>a});olympe.dc.query.Kd=class extends Error{};olympe.dc.query.$={};olympe.dc.query.$.Fd=class extends olympe.dc.query.Aa{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}pd(){return new olympe.dc.query.$.xe(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Kc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b&&c.ob(a),!0)}observe(a,b,c){const d=
684
- Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.xb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Aa.C.rn,p:this.$.map(a=>a.ha())}}Pc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.xb('AND-'+b+a+d))})}};olympe.dc.query.$.hf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.Ka=olympe.dc.ga(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ka]}Kc(a,b){return a instanceof olympe.dc.query.$.hf&&a.Ka===this.Ka?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Ra(){return this.Ka}ob(a){return this.apply(this.db.Ra(a,
685
- this.Ka))}observe(a,b,c){vg(this.db,a,this.Ka,d=>{c(this.apply(d))},olympe.Y.xb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.zc(a);return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ka+'-'+this.substring+'-'+this.C}clear(a,b){wg(this.db,a,this.Ka,olympe.Y.xb(b+a+this.toString()))}Pc(){return{name:'CONTAINS',property:this.Ra(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.pj,
686
- p:this.Ka,s:this.substring,c:this.C}}};olympe.dc.query.$.te=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.Ka=olympe.dc.ga(a);this.C=olympe.dc.nb.zc(null!=b?b:null);this.db=c}Cb(){return[this.Ka]}Kc(a){if(a instanceof olympe.dc.query.$.te&&this.Ka===a.Ka)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Ga(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Ga(a.C)}else return this.C===
687
- a.C;return!1}ob(a){return this.apply(this.db.Ra(a,this.Ka))}observe(a,b,c){vg(this.db,a,this.Ka,d=>{c(this.apply(d))},olympe.Y.xb(b+a+this.toString()));null===this.C&&null===this.db.Ra(a,this.Ka)&&c(!0)}clear(a,b){wg(this.db,a,this.Ka,olympe.Y.xb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.zc(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ga(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Ga(this.C):!1:a===
688
- this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?b:'null';return'Equals-'+this.Ka+'-'+c}Pc(){return{name:'EQUALS',property:this.Ka,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Aa.C.Do,p:this.Ka,t:a,v:b}}};function ji(a,b){return'number'===typeof a.C?a.C:a.db.Ra(b,a.C)}function ki(a,b,c){return olympe.Y.xb(c+b+a.C+a.Ka)}
689
- olympe.dc.query.$.li=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ka=olympe.dc.ga(b);this.C='number'===typeof c?c:olympe.dc.ga(c);this.F=d;this.G=e}pd(){return new olympe.dc.query.$.li(this.db,this.Ka,this.C,!this.F,!this.G)}Cb(){return[this.Ka]}Kc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.li&&this.Ka===a.Ka?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
679
+ class fi{constructor(a,b,c,d){this.H=a;this.db=b;this.K=d;this.T=[];this.O=-1<c.C.max||0<c.C.offset;this.G=new Map;this.C=!1;const e=new Map;for(const f of uh(c)){a=f.V();this.T.push(a);if(f instanceof olympe.dc.query.ta.xh){a=f.relation;a=`${a.Ja()}${a.X()}`;let g;b=null!=(g=this.G.get(a))?g:[];b.push(f);this.G.set(a,b)}hi(f).forEach(g=>{let h;const k=null!=(h=e.get(g))?h:[];k.push(f.V());e.set(g,k)})}this.properties=Array.from(e.entries())}flush(){const a=this.C;this.C=!1;return a}Vc(){}Rc(a,b){if(!(this.C||
680
+ !this.O&&this.db.Ia(a))){var c;this.C||(this.C=null==(c=this.properties)?void 0:c.some(([d,e])=>b.has(d)&&zh(this.K,a,e)))}}F(a){this.C||this.db.Ia(a)&&!this.O||this.C||(this.C=this.T.some(b=>zh(this.K,a,b)))}Ha(a,b,c){if(!this.C&&gi(this,a)){var d=this.db.Ia(b),e=this.db.Ia(c);if(d&&!e||!d&&e){const f=this.G.get($h+a);a=this.G.get(Zh+a);this.C||(this.C=d&&(null==f?void 0:f.some(g=>zh(this.K,b,g.C)))||e&&(null==a?void 0:a.some(g=>zh(this.K,c,g.C))))}}}jc(a,b,c){if(!this.C&&this.O&&gi(this,a)&&this.db.Yr(b,
681
+ new olympe.dc.Na.Relation(a),c)){const d=this.G.get($h+a);a=this.G.get(Zh+a);const e=this.K;this.C||(this.C=(null==d?void 0:d.some(f=>zh(e,b,f.C)&&zh(e,c,f.V())))||(null==a?void 0:a.some(f=>zh(e,c,f.C)&&zh(e,b,f.V()))))}}}olympe.dc.query.uq.ya=[olympe.dc.Writable];function ii(a){return new olympe.dc.query.Relation(a.tag,a.direction,!0)}
682
+ olympe.dc.query.Relation=class extends olympe.dc.Na.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 Qb(a){let b;'string'===typeof a?b=JSON.parse(a):b=a;return new olympe.dc.query.Relation(b.tag,b.direction,b.recursive)}static from(a,b){return new olympe.dc.query.Relation(a.X(),a.Ja(),null!=b?b:a instanceof olympe.dc.da.ye)}cc(){const a=
683
+ olympe.dc.wa.DESTINATION,b=olympe.dc.wa.ORIGIN;return new olympe.dc.query.Relation(this.tag,this.direction===a?b:a,this.recursive)}V(){return`${this.direction}${this.tag}${this.recursive?'-r':''}`}};olympe.dc.query.R={Ca:'dc.query.Logger',Qj:'dc.query.QueryProcessor'};olympe.W.config(function(a){E(a,olympe.dc.query.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('query'));D(a,olympe.dc.query.R.Qj,olympe.dc.query.Qu,olympe.dc.query.R.Ca,olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.Ag,new olympe.W.ja(olympe.dc.U.Ah))});olympe.W.run([olympe.dc.query.R.Qj],a=>{olympe.dc.query.wk=()=>a});olympe.dc.query.Kd=class extends Error{};olympe.dc.query.$={};olympe.dc.query.$.Fd=class extends olympe.dc.query.Aa{constructor(...a){super();this.$=a}compile(){return this.$.reduce((a,b)=>{const c=[];for(const d of b.compile()){for(const e of a)d.push(...e);c.push(d)}return c},[])}pd(){return new olympe.dc.query.$.we(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Lc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b&&c.ob(a),!0)}observe(a,b,c){const d=
684
+ Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.every(k=>k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.xb('AND-'+b+a+h),f.bind(null,h))})}ha(){return{pr:olympe.dc.query.Aa.C.rn,p:this.$.map(a=>a.ha())}}Qc(){throw Error('toObject for AND predicate should not be called');}toString(){return'And-'+this.$.reduce((a,b)=>a+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.xb('AND-'+b+a+d))})}};olympe.dc.query.$.hf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!1){super();this.Ka=olympe.dc.ga(a);this.substring=b;this.db=c;this.C=d}Cb(){return[this.Ka]}Lc(a,b){return a instanceof olympe.dc.query.$.hf&&a.Ka===this.Ka?b?a.C?a.substring.toLowerCase().includes(this.substring.toLowerCase()):a.substring.includes(this.substring):this.C?this.substring.toLowerCase().includes(a.substring.toLowerCase()):this.substring.includes(a.substring):!1}Ra(){return this.Ka}ob(a){return this.apply(this.db.Ra(a,
685
+ this.Ka))}observe(a,b,c){vg(this.db,a,this.Ka,d=>{c(this.apply(d))},olympe.Y.xb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'string'===typeof a?this.C?a.includes(this.substring):a.toLowerCase().includes(this.substring.toLowerCase()):!1}toString(){return'Contains'+this.Ka+'-'+this.substring+'-'+this.C}clear(a,b){wg(this.db,a,this.Ka,olympe.Y.xb(b+a+this.toString()))}Qc(){return{name:'CONTAINS',property:this.Ra(),value:this.substring,caseSensitive:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.pj,
686
+ p:this.Ka,s:this.substring,c:this.C}}};olympe.dc.query.$.se=class extends olympe.dc.query.Aa{constructor(a,b,c){super();this.Ka=olympe.dc.ga(a);this.C=olympe.dc.nb.Ac(null!=b?b:null);this.db=c}Cb(){return[this.Ka]}Lc(a){if(a instanceof olympe.dc.query.$.se&&this.Ka===a.Ka)if('object'===typeof this.C&&null!==this.C){if(this.C instanceof olympe.dc.CloudObject)return this.C.Ga(a.C);if(this.C instanceof Date)return a.C instanceof Date&&this.C.getTime()===a.C.getTime();if(this.C instanceof olympe.D.Color)return this.C.Ga(a.C)}else return this.C===
687
+ a.C;return!1}ob(a){return this.apply(this.db.Ra(a,this.Ka))}observe(a,b,c){vg(this.db,a,this.Ka,d=>{c(this.apply(d))},olympe.Y.xb(b+a+this.toString()));null===this.C&&null===this.db.Ra(a,this.Ka)&&c(!0)}clear(a,b){wg(this.db,a,this.Ka,olympe.Y.xb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);return'object'===typeof a&&null!==a?a instanceof olympe.dc.CloudObject?a.Ga(this.C):a instanceof Date?this.C instanceof Date&&this.C.getTime()===a.getTime():a instanceof olympe.D.Color?a.Ga(this.C):!1:a===
688
+ this.C}toString(){let a,b;const c=null!=(b=null==(a=this.C)?void 0:a.toString())?b:'null';return'Equals-'+this.Ka+'-'+c}Qc(){return{name:'EQUALS',property:this.Ka,value:this.C}}ha(){let a=1,b=this.C;switch(!0){case this.C instanceof Date:a=2;b=this.C.toJSON();break;case this.C instanceof olympe.dc.CloudObject:a=3;b=this.C.X();break;case this.C instanceof olympe.D.Color:a=4,b=this.C.toJSON()}return{pr:olympe.dc.query.Aa.C.Do,p:this.Ka,t:a,v:b}}};function ji(a,b){return'number'===typeof a.C?a.C:a.db.Ra(b,a.C)}function ki(a,b,c){return olympe.Y.xb(c+b+a.C+a.Ka)}
689
+ olympe.dc.query.$.mi=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0,e=!0){super();this.db=a;this.Ka=olympe.dc.ga(b);this.C='number'===typeof c?c:olympe.dc.ga(c);this.F=d;this.G=e}pd(){return new olympe.dc.query.$.mi(this.db,this.Ka,this.C,!this.F,!this.G)}Cb(){return[this.Ka]}Lc(a,b){if(b)throw Error('Check coverage of inequality should not happen with opposite = true');return a instanceof olympe.dc.query.$.mi&&this.Ka===a.Ka?typeof this.C!==typeof a.C||this.F!==a.F?!1:'number'===typeof this.C?
690
690
  this.F&&this.C>=a.C||!this.F&&this.C<=a.C:this.C===a.C:!1}Ra(){return this.Ka}ob(a){return this.compare(this.db.Ra(a,this.Ka),ji(this,a))}observe(a,b,c){'string'===typeof this.C&&vg(this.db,a,this.C,d=>{const e=this.db.Ra(a,this.Ka);null!==e&&c(this.compare(e,d))},ki(this,a,b));vg(this.db,a,this.Ka,d=>{const e=ji(this,a);c(null!==e?this.compare(d,e):!0)},ki(this,a,b))}compare(a,b){return null===a?!1:null===b?!0:this.G?this.F?a<b:a>b:this.F?a<=b:a>=b}clear(a,b){wg(this.db,a,this.Ka,ki(this,a,b));'string'===
691
- typeof this.C&&wg(this.db,a,this.C,ki(this,a,b))}Pc(){return{name:'INEQUALITY_OPERATOR',property:this.Ra(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.kp,p:this.Ka,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ka+'-'+this.G+'-'+this.C}};olympe.dc.query.$.ce=class extends olympe.dc.query.Aa{constructor(a){super();this.C=a}compile(){const a=this.C.pd();return this.Ga(a)?super.compile():a.compile()}pd(){return this.C}Cb(){return this.C.Cb()}Kc(a,b){return a instanceof olympe.dc.query.$.ce?this.C.Kc(a.C,b):this.C.Kc(a,!b)}ob(a){return!this.C.ob(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.xb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Pc(){return{name:'NOT',predicate:this.C.Pc()}}ha(){return{pr:olympe.dc.query.Aa.C.Mp,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
692
- b){this.C.clear(a,olympe.Y.xb('NOT'+b+a))}Ga(a){return a instanceof olympe.dc.query.$.ce?this.C.Ga(a.C):!1}};olympe.dc.query.$.xe=class extends olympe.dc.query.Aa{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}pd(){return new olympe.dc.query.$.Fd(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Kc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b||c.ob(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
693
- k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.xb('OR-'+b+a+h),f.bind(null,h))})}Pc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Aa.C.Zp,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.xb('OR-'+b+a+d))})}};olympe.dc.query.$.rf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.Ka=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.Ka]}Kc(a){return a instanceof olympe.dc.query.$.rf&&this.Ka===a.Ka&&this.C.toString()===a.C.toString()}ob(a){return this.apply(this.db.Ra(a,this.Ka))}observe(a,b,c){vg(this.db,a,this.Ka,d=>{c(this.apply(d))},olympe.Y.xb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.zc(a);
694
- return'string'===typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.Ka+'-'+this.C.toString()+'-'+this.F}Pc(){return{name:'REGEX',property:this.Ka,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Aa.C.wq,p:this.Ka,r:this.C.source,c:this.F}}clear(a,b){wg(this.db,a,this.Ka,olympe.Y.xb(b+a+this.toString()))}};olympe.dc.query.$.om=class extends olympe.dc.query.Aa{constructor(a){super();this.C=new Set(a.map(olympe.dc.ga))}Cb(){return[]}Kc(a){return a instanceof olympe.dc.query.$.om&&Array.from(a.C).every(b=>this.C.has(b))}ob(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Pc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Aa.C.$q,t:Array.from(this.C)}}};olympe.dc.query.ta={};function hi(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.Fb&&d.add(null==(e=a.Fb)?void 0:e.Ra().X());return d}function li(a){if(!a.ea){let b,c;a.ea=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ea}function mi(a,b){for(const c of b)if(a.some(d=>d.Kc(c,!1)))return!0;return!1}
695
- function ni(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.xb(h+f+d);e?a.F.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function oi(a,b,c){if(null===a.Fb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Fb.Ra();h=olympe.Y.xb(h+d);e?vg(a.db,f,k,()=>{xh(b)},h):wg(a.db,f,k,h);c(e,f,g,h)}}
696
- olympe.dc.query.ta.Zl=class{constructor(a,b){this.db=olympe.dc.ia();this.C=a;this.optional=b;this.ea=this.Fb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ta.Rd(b,a.f);var c=a.o;const d=new olympe.dc.Na.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ta.ue(b,d,a.s,c):new olympe.dc.query.ta.kh(b,d,c);void 0!==a.p&&(b.F=Gh(a.p));void 0!==a.c&&(c=b.V(),a=a.c,a=new olympe.dc.query.gf(c,new olympe.dc.Na.Property(a.p),a.o),b.Fb=a);return b}O(){}J(){let a,
697
- b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Fb)?void 0:b.toString())?d:''}`}Pc(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Fb&&(a.c=this.Fb.ha());return a}Z(){}ua(){return new olympe.dc.query.ta.hm}aa(){}V(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}Kc(a){const b=li(this);if(0===b.length)return!0;a=li(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
698
- mi(d,c)))return!1;return!0}filter(a){const b=this.O(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.Fd?new olympe.dc.query.$.Fd(...Array.from(c.$),a):new olympe.dc.query.$.Fd(b.F,a);return b}sort(a,b){const c=this.O();c.Fb=new olympe.dc.query.gf(this.V(),a,b);return c}Ng(){return this.Fb}ob(a){if(null!==this.F){var b=this.V();for(const c of yh(a,b))this.F.ob(c)||a.remove(c,b,null)}}observe(a,b){const c=this.V();return ni(this,oi(this,a,(d,e,f,g)=>{(d?Ah(a,e,c,f):a.remove(e,c,f))&&b(d,e,
699
- f,g)}))}Ga(){}};olympe.dc.query.ta.wh=class extends olympe.dc.query.ta.Zl{constructor(a,b,c){super(a,c);this.relation=b;this.ka=null}};olympe.dc.query.ta.kq=class{has(){}O(){}F(){}bd(){}G(){}remove(){}};olympe.dc.query.ta.io=class{constructor(a){this.C=null;this.content=new Map;this.J=null!=a?a:null}bd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}O(a){let b;return(null==(b=this.J)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
700
- c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ta.io.ya=[olympe.dc.query.ta.kq];olympe.dc.query.ta.kh=class extends olympe.dc.query.ta.wh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}O(){const a=new olympe.dc.query.ta.kh(this.C,this.relation,this.optional);a.F=this.F;a.Fb=this.Fb;return a}Z(){return olympe.Y.xb(this.C+this.relation.V())}aa(a,b){if(b instanceof olympe.dc.query.ta.Rd)return[a];const c=[a+this.relation.V(),a+ii(this.relation).V()+!1,a+ii(this.relation).V()+!0,a+'followRules'].map(d=>olympe.Y.xb(d));b instanceof olympe.dc.query.ta.ue&&c.push(a);
701
- return c}ob(a){const b=this.V();for(const c of yh(a,this.C))this.db.bb(c,this.relation).forEach(d=>{Ah(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ja();return(f,g,h,k)=>{const l=olympe.Y.xb(k+g+this.toString());f?V(this.db,g,this.relation,(n,p)=>{Bh(a,n,d,e,g,p);c(n,p,g,l)},l):this.db.F(g,this.relation,l)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Ja()})}J(){return`followPart-${this.relation.V()}-${super.J()}`}Pc(){const a=
702
- {recursive:!1,relation:this.relation,filter:li(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Fb&&(a.sort={property:this.Fb.Ra(),order:this.Fb.oi});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()}}Ga(a){return a instanceof olympe.dc.query.ta.kh&&this.relation.Ga(a.relation)}};olympe.dc.query.ta.ue=class extends olympe.dc.query.ta.wh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.G=c}O(){const a=new olympe.dc.query.ta.ue(this.C,this.relation,this.G,this.optional);a.F=this.F;a.Fb=this.Fb;return a}Z(){return olympe.Y.xb(this.C+this.relation.V()+this.G)}aa(a,b){if(b instanceof olympe.dc.query.ta.Rd)return[a];const c=[a+this.relation.V()+this.G,a+'followRules'].map(d=>olympe.Y.xb(d));b instanceof olympe.dc.query.ta.ue&&c.push(a);return c}ob(a){const b=
691
+ typeof this.C&&wg(this.db,a,this.C,ki(this,a,b))}Qc(){return{name:'INEQUALITY_OPERATOR',property:this.Ra(),operator:this.F?'<':'>',strict:this.G,value:this.C}}ha(){return{pr:olympe.dc.query.Aa.C.lp,p:this.Ka,b:this.C,l:this.F,s:this.G}}toString(){return'GreaterThan-'+this.Ka+'-'+this.G+'-'+this.C}};olympe.dc.query.$.ce=class extends olympe.dc.query.Aa{constructor(a){super();this.C=a}compile(){const a=this.C.pd();return this.Ga(a)?super.compile():a.compile()}pd(){return this.C}Cb(){return this.C.Cb()}Lc(a,b){return a instanceof olympe.dc.query.$.ce?this.C.Lc(a.C,b):this.C.Lc(a,!b)}ob(a){return!this.C.ob(a)}observe(a,b,c){let d=null;this.C.observe(a,olympe.Y.xb('NOT'+b+a),e=>{!e!==d&&(d=!e,c(d))})}Qc(){return{name:'NOT',predicate:this.C.Qc()}}ha(){return{pr:olympe.dc.query.Aa.C.Np,v:this.C.ha()}}toString(){return`NOT-${this.C.toString()}`}clear(a,
692
+ b){this.C.clear(a,olympe.Y.xb('NOT'+b+a))}Ga(a){return a instanceof olympe.dc.query.$.ce?this.C.Ga(a.C):!1}};olympe.dc.query.$.we=class extends olympe.dc.query.Aa{constructor(...a){super();this.$=a}compile(){return this.$.map(a=>a.compile()).flat()}pd(){return new olympe.dc.query.$.Fd(...this.$.map(a=>a.pd()))}Cb(){return this.$.flatMap(a=>a.Cb())}Lc(){throw Error('Should not try to check predicate coverage on And (should be removed by compiling predicates');}ob(a){return this.$.reduce((b,c)=>b||c.ob(a),!1)}observe(a,b,c){const d=Array(this.$.length).fill(!1);let e=null;const f=(g,h)=>{d[g]=h;g=d.some(k=>
693
+ k);e!==g&&(e=g,c(g))};this.$.forEach((g,h)=>{g.observe(a,olympe.Y.xb('OR-'+b+a+h),f.bind(null,h))})}Qc(){throw Error('toObject for OR predicate should not be called');}ha(){return{pr:olympe.dc.query.Aa.C.$p,p:this.$.map(a=>a.ha())}}toString(){return'And-'+this.$.reduce((a,b)=>a.toString()+'-'+b.toString(),'')}clear(a,b){this.$.forEach((c,d)=>{c.clear(a,olympe.Y.xb('OR-'+b+a+d))})}};olympe.dc.query.$.sf=class extends olympe.dc.query.Aa{constructor(a,b,c,d=!0){super();this.Ka=olympe.dc.ga(a);this.C='string'===typeof b?new RegExp(d?b:b.toLowerCase()):d?b:new RegExp(b.source.toLowerCase());this.db=c;this.F=d}Cb(){return[this.Ka]}Lc(a){return a instanceof olympe.dc.query.$.sf&&this.Ka===a.Ka&&this.C.toString()===a.C.toString()}ob(a){return this.apply(this.db.Ra(a,this.Ka))}observe(a,b,c){vg(this.db,a,this.Ka,d=>{c(this.apply(d))},olympe.Y.xb(b+a+this.toString()))}apply(a){a=olympe.dc.nb.Ac(a);
694
+ return'string'===typeof a?this.C.test(this.F?a:a.toLowerCase()):!1}toString(){return'Regex'+this.Ka+'-'+this.C.toString()+'-'+this.F}Qc(){return{name:'REGEX',property:this.Ka,pattern:this.C,caseSensitive:this.F}}ha(){return{pr:olympe.dc.query.Aa.C.xq,p:this.Ka,r:this.C.source,c:this.F}}clear(a,b){wg(this.db,a,this.Ka,olympe.Y.xb(b+a+this.toString()))}};olympe.dc.query.$.om=class extends olympe.dc.query.Aa{constructor(a){super();this.C=new Set(a.map(olympe.dc.ga))}Cb(){return[]}Lc(a){return a instanceof olympe.dc.query.$.om&&Array.from(a.C).every(b=>this.C.has(b))}ob(a){return this.C.has(a)}observe(a,b,c){c(this.C.has(a))}clear(){}toString(){return'Tags-'+Array.from(this.C)}Qc(){return{name:'IS',tags:Array.from(this.C)}}ha(){return{pr:olympe.dc.query.Aa.C.ar,t:Array.from(this.C)}}};olympe.dc.query.ta={};function hi(a){let b,c;const d=new Set(null!=(c=null==(b=a.F)?void 0:b.Cb())?c:[]);let e;a.Gb&&d.add(null==(e=a.Gb)?void 0:e.Ra().X());return d}function li(a){if(!a.ea){let b,c;a.ea=null!=(c=null==(b=a.F)?void 0:b.compile())?c:[]}return a.ea}function mi(a,b){for(const c of b)if(a.some(d=>d.Lc(c,!1)))return!0;return!1}
695
+ function ni(a,b){if(null===a.F)return b;let c=!1;const d=a.toString();return(e,f,g,h)=>{const k=olympe.Y.xb(h+f+d);e?a.F.observe(f,k,l=>{c||b(l,f,g,k)}):(c=!0,a.F.clear(f,k),c=!1,b(!1,f,g,k))}}function oi(a,b,c){if(null===a.Gb)return c;const d=a.toString();return(e,f,g,h)=>{const k=a.Gb.Ra();h=olympe.Y.xb(h+d);e?vg(a.db,f,k,()=>{xh(b)},h):wg(a.db,f,k,h);c(e,f,g,h)}}
696
+ olympe.dc.query.ta.Zl=class{constructor(a,b){this.db=olympe.dc.ia();this.C=a;this.optional=b;this.ea=this.Gb=this.F=this.id=null}static C(a){var b=a.i;if('string'===typeof a.f)return new olympe.dc.query.ta.Rd(b,a.f);var c=a.o;const d=new olympe.dc.Na.Relation(a.t,a.d);b='boolean'===typeof a.s?new olympe.dc.query.ta.te(b,d,a.s,c):new olympe.dc.query.ta.kh(b,d,c);void 0!==a.p&&(b.F=Gh(a.p));void 0!==a.c&&(c=b.V(),a=a.c,a=new olympe.dc.query.gf(c,new olympe.dc.Na.Property(a.p),a.o),b.Gb=a);return b}O(){}K(){let a,
697
+ b,c,d;return`${this.C}-${this.optional}${null!=(c=null==(a=this.F)?void 0:a.toString())?c:''}${null!=(d=null==(b=this.Gb)?void 0:b.toString())?d:''}`}Qc(){}toJSON(){}ha(){const a={i:this.C,o:this.optional};null!==this.F&&(a.p=this.F.ha());null!==this.Gb&&(a.c=this.Gb.ha());return a}Z(){}ua(){return new olympe.dc.query.ta.hm}aa(){}V(){null===this.id&&(this.id=this.Z());return this.id}T(){return this.optional}Lc(a){const b=li(this);if(0===b.length)return!0;a=li(a);if(0===a.length)return!1;for(const c of a)if(!b.some(d=>
698
+ mi(d,c)))return!1;return!0}filter(a){const b=this.O(),c=b.F;null===c?b.F=a:b.F=c instanceof olympe.dc.query.$.Fd?new olympe.dc.query.$.Fd(...Array.from(c.$),a):new olympe.dc.query.$.Fd(b.F,a);return b}sort(a,b){const c=this.O();c.Gb=new olympe.dc.query.gf(this.V(),a,b);return c}Ng(){return this.Gb}ob(a){if(null!==this.F){var b=this.V();for(const c of yh(a,b))this.F.ob(c)||a.remove(c,b,null)}}observe(a,b){const c=this.V();return ni(this,oi(this,a,(d,e,f,g)=>{(d?Ah(a,e,c,f):a.remove(e,c,f))&&b(d,e,
699
+ f,g)}))}Ga(){}};olympe.dc.query.ta.xh=class extends olympe.dc.query.ta.Zl{constructor(a,b,c){super(a,c);this.relation=b;this.ka=null}};olympe.dc.query.ta.lq=class{has(){}O(){}F(){}bd(){}G(){}remove(){}};olympe.dc.query.ta.io=class{constructor(a){this.C=null;this.content=new Map;this.K=null!=a?a:null}bd(){return this.content.keys()}F(a){return this.content.has(a)&&null!==this.C?[this.C].values():[].values()}has(a){return this.content.has(a)}O(a){let b;return(null==(b=this.K)?void 0:b.call(this,a))||!1}G(a,b){if(null===this.C)this.C=b;else if(b!==this.C)throw Error('Should never try to insert multi parent in the same counter part result. To be used with FollowRulePart only');let c;b=null!=(c=this.content.get(a))?
700
+ c:0;this.content.set(a,b+1);return 0===b}remove(a,b){if(null===b)return this.content.delete(a);b=this.content.get(a);1<b?this.content.set(a,b-1):this.content.delete(a);return 1===b}};olympe.dc.query.ta.io.ya=[olympe.dc.query.ta.lq];olympe.dc.query.ta.kh=class extends olympe.dc.query.ta.xh{constructor(a,b,c){super(a,olympe.dc.query.Relation.from(b,!1),c)}O(){const a=new olympe.dc.query.ta.kh(this.C,this.relation,this.optional);a.F=this.F;a.Gb=this.Gb;return a}Z(){return olympe.Y.xb(this.C+this.relation.V())}aa(a,b){if(b instanceof olympe.dc.query.ta.Rd)return[a];const c=[a+this.relation.V(),a+ii(this.relation).V()+!1,a+ii(this.relation).V()+!0,a+'followRules'].map(d=>olympe.Y.xb(d));b instanceof olympe.dc.query.ta.te&&c.push(a);
701
+ return c}ob(a){const b=this.V();for(const c of yh(a,this.C))this.db.bb(c,this.relation).forEach(d=>{Ah(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ja();return(f,g,h,k)=>{const l=olympe.Y.xb(k+g+this.toString());f?V(this.db,g,this.relation,(n,p)=>{Bh(a,n,d,e,g,p);c(n,p,g,l)},l):this.db.F(g,this.relation,l)}}ha(){return Object.assign(super.ha(),{t:this.relation.X(),d:this.relation.Ja()})}K(){return`followPart-${this.relation.V()}-${super.K()}`}Qc(){const a=
702
+ {recursive:!1,relation:this.relation,filter:li(this).map(b=>b.map(c=>c.Qc())),optional:this.T()};this.Gb&&(a.sort={property:this.Gb.Ra(),order:this.Gb.ri});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()}}Ga(a){return a instanceof olympe.dc.query.ta.kh&&this.relation.Ga(a.relation)}};olympe.dc.query.ta.te=class extends olympe.dc.query.ta.xh{constructor(a,b,c,d){super(a,olympe.dc.query.Relation.from(b,!0),d);this.G=c}O(){const a=new olympe.dc.query.ta.te(this.C,this.relation,this.G,this.optional);a.F=this.F;a.Gb=this.Gb;return a}Z(){return olympe.Y.xb(this.C+this.relation.V()+this.G)}aa(a,b){if(b instanceof olympe.dc.query.ta.Rd)return[a];const c=[a+this.relation.V()+this.G,a+'followRules'].map(d=>olympe.Y.xb(d));b instanceof olympe.dc.query.ta.te&&c.push(a);return c}ob(a){const b=
703
703
  this.V();for(const c of yh(a,this.C))this.G&&Ah(a,c,b,c),this.db.Rg(c,this.relation).forEach(d=>{Ah(a,d,b,c)});super.ob(a)}observe(a,b){const c=super.observe(a,b),d=this.relation.X(),e=this.relation.Ja(),f=new Set,g=(h,k,l,n,p)=>{k=olympe.Y.xb(k+h+p+l);if(this.G||0<l)0<l&&Bh(a,n,d,e,h,p),c(n,p,h,k);n?f.has(p)||(f.add(p),V(this.db,p,this.relation,g.bind(this,h,k,l+1),k)):(f.delete(p),this.db.F(p,this.relation,k))};return(h,k,l,n)=>g(k,n+this.toString(),0,h,k)}ha(){return Object.assign(super.ha(),{s:this.G,
704
- t:this.relation.X(),d:this.relation.Ja()})}J(){return`followRecursivelyPart-${this.relation.V()}-${this.G}-${super.J()}`}Pc(){const a={recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:li(this).map(b=>b.map(c=>c.Pc())),optional:this.T()};this.Fb&&(a.sort={property:this.Fb.Ra(),order:this.Fb.oi});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ga(a){return a instanceof
705
- olympe.dc.query.ta.ue&&this.relation.Ga(a.relation)&&this.G===a.G}};olympe.dc.query.ta.Rd=class extends olympe.dc.query.ta.Zl{constructor(a,b,c){super(a,!1);this.Pb=b;this.G=null!=c?c:null}O(){return new olympe.dc.query.ta.Rd(this.C,this.Pb,this.G)}Z(){return olympe.Y.xb(this.C+'followRules')}ua(){return new olympe.dc.query.ta.io(this.G)}aa(a,b){return b instanceof olympe.dc.query.ta.Rd?[a]:[olympe.Y.xb(a+'followRules')]}Kc(a){if(a instanceof olympe.dc.query.ta.wh){const b=olympe.dc.wa.ORIGIN,c=olympe.dc.wa.DESTINATION,d=olympe.dc.nc.Zc,e=olympe.dc.nc.ei,f=olympe.dm.Relation.C.em,
704
+ t:this.relation.X(),d:this.relation.Ja()})}K(){return`followRecursivelyPart-${this.relation.V()}-${this.G}-${super.K()}`}Qc(){const a={recursive:this.G?'INCLUDE_SELF':'EXCLUDE_SELF',relation:this.relation,filter:li(this).map(b=>b.map(c=>c.Qc())),optional:this.T()};this.Gb&&(a.sort={property:this.Gb.Ra(),order:this.Gb.ri});return a}toString(){return`FollowRecursively Part: ${this.relation}`}toJSON(){return{type:'follow recursively',relation:`${this.db.name(this.relation)} (${this.relation.X()})`,direction:this.relation.Ja()}}Ga(a){return a instanceof
705
+ olympe.dc.query.ta.te&&this.relation.Ga(a.relation)&&this.G===a.G}};olympe.dc.query.ta.Rd=class extends olympe.dc.query.ta.Zl{constructor(a,b,c){super(a,!1);this.Pb=b;this.G=null!=c?c:null}O(){return new olympe.dc.query.ta.Rd(this.C,this.Pb,this.G)}Z(){return olympe.Y.xb(this.C+'followRules')}ua(){return new olympe.dc.query.ta.io(this.G)}aa(a,b){return b instanceof olympe.dc.query.ta.Rd?[a]:[olympe.Y.xb(a+'followRules')]}Lc(a){if(a instanceof olympe.dc.query.ta.xh){const b=olympe.dc.wa.ORIGIN,c=olympe.dc.wa.DESTINATION,d=olympe.dc.nc.Zc,e=olympe.dc.nc.fi,f=olympe.dm.Relation.C.em,
706
706
  g=olympe.dm.Relation.C.qm;a=a.relation;const h=a.Ja(),k=a.X();return h!==c||k!==d&&k!==e?!!(Eg(this.db,a,this.Pb)&(a.Ja()===b?f:g)):!0}return a instanceof olympe.dc.query.ta.Rd?this.Pb===a.Pb:!1}ob(a){const b=this.V();for(const c of yh(a,this.C))for(const d of Cf(this.db,c,this.Pb))Ah(a,d,b,c)}observe(a,b){const c=this.V(),d=(e,f,g,h,k)=>{const l=`${h}:${g}`;f?Fg(this.db,g,this.Pb,(n,p,q,r,t)=>{q&&!k.includes(t)&&(q=r?Ah(a,t,c,e):a.remove(t,c,e),null!==p&&Bh(a,r,n,p,g,t),q&&d(e,r,t,h,new pi(t,k)))},
707
- l):Gg(this.db,g,this.Pb,l);b(f,g,e,l)};return(e,f,g,h)=>{g=olympe.Y.xb(h+f+this.toString());(e?Ah(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g,new pi(f,null))}}ha(){return Object.assign(super.ha(),{f:this.Pb})}J(){return`followRulePart-${this.Pb}-${super.J()}`}Pc(){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.Pb)} (${this.Pb})`}Ga(a){return a instanceof olympe.dc.query.ta.Rd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
708
- rule:`${this.db.name(this.Pb)} (${this.Pb})`}}T(){return!1}filter(){olympe.ma.gb('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ma.gb('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ta.Rd.F='followRules';
709
- class pi{constructor(a,b){this.tag=a;this.C=b}includes(a){let b;return this.tag===a||!(null==(b=this.C)||!b.includes(a))}toString(){return this.C?`${this.C.toString()} -> ${this.tag}`:this.tag}};olympe.dc.query.ta.hm=class{constructor(){this.content=new Map}bd(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ta.hm.ya=[olympe.dc.query.ta.kq];olympe.dc.sources={};olympe.dc.sources.Iq=class extends Error{};olympe.dc.sources.uj=class{V(){}init(){}destroy(){}request(){return v(function*(){})}ea(){}};const qi=olympe.net.Ba.Sd.GET,ri=olympe.net.Ba.Sd.th,si=olympe.net.Ba.Sd.Cc,ti=olympe.net.Ba.Sd.jq,ui=olympe.net.Ba.Headers.bi,vi=olympe.net.Ba.Headers.Dn,wi=olympe.net.Ba.$b.rh,xi=olympe.net.Ba.$b.Yn,yi=olympe.net.Ba.$b.Mo,zi=olympe.net.Ba.$b.Bi,Ai=olympe.net.Ba.$b.Ml;
710
- function Bi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.ul)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.J('_DataSourcesHTTPService',b,[qi,ri,si,ti],(c,d,e)=>v(function*(){const f=d.get('sourceId');var g=a.G.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.ae(`No handler found for datasource ${f} called '${g}'`,Ai,'Invalid source id'))}h=c.method;const k=c.Wi();try{var l=yield Ci(a,
711
- k[vi])}catch(r){return new olympe.net.ae(`Invalid token ${r}`,yi,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Lb,t=olympe.dc.Request.C.yg,u=olympe.dc.Request.C.Ve,x=olympe.dc.Request.C.Ig,y=olympe.dc.Request.C.ah,z=olympe.dc.Request.C.og,A=olympe.dc.Request.C.Of,B=olympe.dc.Request.C.Xf;let O;switch(n){case r:break;case t:case u:case y:case x:O=a.F.J(p);break;case B:case z:case A:O={tag:e.get('tag'),model:e.get('model'),mimeType:k[ui]};p instanceof Uint8Array&&
712
- (O.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let M;const xa=null!=(M=k['X-Source-Origin'])?M:olympe.dc.Qa.qf;var q=df(new olympe.dc.Request(n,f,O,l),xa);const Pa=yield g(q);let Uc;void 0===Pa?Uc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Uc=Pa:Uc=JSON.stringify(a.F.ha(Pa));return new olympe.net.ae(Uc,h===ti?xi:wi)}catch(r){return r instanceof olympe.dc.sources.Iq?new olympe.net.ae(`Authorization error: ${r}`,
707
+ l):Gg(this.db,g,this.Pb,l);b(f,g,e,l)};return(e,f,g,h)=>{g=olympe.Y.xb(h+f+this.toString());(e?Ah(a,f,c,f):a.remove(f,c,f))&&d(f,e,f,g,new pi(f,null))}}ha(){return Object.assign(super.ha(),{f:this.Pb})}K(){return`followRulePart-${this.Pb}-${super.K()}`}Qc(){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.Pb)} (${this.Pb})`}Ga(a){return a instanceof olympe.dc.query.ta.Rd&&this.Pb===a.Pb}toJSON(){return{type:'follow rule',
708
+ rule:`${this.db.name(this.Pb)} (${this.Pb})`}}T(){return!1}filter(){olympe.ma.hb('dc.query').warn('Should never try to filter on queries with follow rules, ignore...');return this}sort(){olympe.ma.hb('dc.query').warn('Should never try to sort queries with follow rules, ignore...');return this}};olympe.dc.query.ta.Rd.F='followRules';
709
+ class pi{constructor(a,b){this.tag=a;this.C=b}includes(a){let b;return this.tag===a||!(null==(b=this.C)||!b.includes(a))}toString(){return this.C?`${this.C.toString()} -> ${this.tag}`:this.tag}};olympe.dc.query.ta.hm=class{constructor(){this.content=new Map}bd(){return this.content.keys()}F(a){let b,c;return null!=(c=null==(b=this.content.get(a))?void 0:b.values())?c:[]}has(a){return this.content.has(a)}O(){return!1}G(a,b){let c=this.content.get(a);c||(c=new Set,this.content.set(a,c));a=c.size;c.add(b);return a<c.size}remove(a,b){if(null===b)return this.content.delete(a);const c=this.content.get(a);b=c.delete(b);0===c.size&&this.content.delete(a);return b}};olympe.dc.query.ta.hm.ya=[olympe.dc.query.ta.lq];olympe.dc.sources={};olympe.dc.sources.Jq=class extends Error{};olympe.dc.sources.uj=class{V(){}init(){}destroy(){}request(){return v(function*(){})}ea(){}};const qi=olympe.net.Ba.Sd.GET,ri=olympe.net.Ba.Sd.uh,si=olympe.net.Ba.Sd.Dc,ti=olympe.net.Ba.Sd.kq,ui=olympe.net.Ba.Headers.ci,vi=olympe.net.Ba.Headers.Dn,wi=olympe.net.Ba.$b.rh,xi=olympe.net.Ba.$b.Yn,yi=olympe.net.Ba.$b.Mo,zi=olympe.net.Ba.$b.Bi,Ai=olympe.net.Ba.$b.Ml;
710
+ function Bi(a){const b=`/${olympe.W.getParameter(olympe.dc.sources.U.ul)}/:${'sourceId'}/:${'requestType'}`.replace(/\/+/g,'/').replace(/\/$/,'');a.T.K('_DataSourcesHTTPService',b,[qi,ri,si,ti],(c,d,e)=>v(function*(){const f=d.get('sourceId');var g=a.G.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.ae(`No handler found for datasource ${f} called '${g}'`,Ai,'Invalid source id'))}h=c.method;const k=c.Wi();try{var l=yield Ci(a,
711
+ k[vi])}catch(r){return new olympe.net.ae(`Invalid token ${r}`,yi,'Access denied')}try{var n=Number(d.get('requestType')),p=c.body;const r=olympe.dc.Request.C.Lb,t=olympe.dc.Request.C.yg,u=olympe.dc.Request.C.Ve,x=olympe.dc.Request.C.Ig,y=olympe.dc.Request.C.ah,z=olympe.dc.Request.C.og,A=olympe.dc.Request.C.Pf,B=olympe.dc.Request.C.Xf;let O;switch(n){case r:break;case t:case u:case y:case x:O=a.F.O(p);break;case B:case z:case A:O={tag:e.get('tag'),model:e.get('model'),mimeType:k[ui]};p instanceof Uint8Array&&
712
+ (O.content=p);break;default:throw Error(`Data Http request type not supported ${n}`);}let M;const xa=null!=(M=k['X-Source-Origin'])?M:olympe.dc.Qa.rf;var q=df(new olympe.dc.Request(n,f,O,l),xa);const Pa=yield g(q);let Uc;void 0===Pa?Uc='':Pa instanceof Blob||Pa instanceof Uint8Array||Pa instanceof ArrayBuffer||'function'===typeof(null==Pa?void 0:Pa.pipe)?Uc=Pa:Uc=JSON.stringify(a.F.ha(Pa));return new olympe.net.ae(Uc,h===ti?xi:wi)}catch(r){return r instanceof olympe.dc.sources.Jq?new olympe.net.ae(`Authorization error: ${r}`,
713
713
  yi,'Forbidden'):new olympe.net.ae(`Internal server error: ${r}`,zi,'Internal server error')}})).catch(c=>a.H.error(`Error while starting the HTTP Service: ${c}`));a.H.debug(`Started HTTP service with path: ${b}`)}function Di(a){a.T.Z('_DataSourcesHTTPService').catch(b=>{a.H.error(`An error occurred while stopping the data sources http service: ${b}`)})}function Ei(a,b,c){0===a.G.size&&Bi(a);a.G.set(b,c);return()=>{a.G.delete(b);0===a.G.size&&Di(a)}}
714
714
  function Fi(a,b,c){c=b instanceof olympe.dm.DataSource?b.Fe(c):Gi(b,c);null===c&&a.H.error(`Impossible to build URL for data source ${b}`);return c}
715
- function Hi(a,b,c){if(b===olympe.dc.Qa.SERVER){var d;return null!=(d=zd(a.J,a.ea.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.aa.sb(b);e=olympe.dc.sources.U.vl;const f=olympe.dc.sources.U.ii,g=olympe.dc.sources.U.hp,h=olympe.dc.sources.U.ul;let k;e=`${Fi(a,null!=d?d:b,g)?'https':'http'}://${Fi(a,null!=d?d:b,e)}:${null!=(k=Fi(a,null!=d?d:b,f))?k:Fi(a,null!=d?d:b,g)?443:80}`+`/${Fi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.set(b,e)}return`${e}/${c}`}
716
- function Ii(a,b){return b instanceof olympe.net.ki?Bd(a.J,b,gd(a.Z).wd()):Promise.reject('No http request to send')}function Ji(a,b){var c=Hi(a,b.pc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.pc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=N(c,ri,e);oc(c,{['X-Source-Origin']:b.origin,[ui]:'application/json'});return Ii(a,c).then(f=>'string'===typeof f?a.F.J(JSON.parse(f)):olympe.dc.query.td.Ti(d))}
715
+ function Hi(a,b,c){if(b===olympe.dc.Qa.SERVER){var d;return null!=(d=zd(a.K,a.ea.get(c)))?d:null}var e=a.O.get(b);if(!e){d=a.aa.sb(b);e=olympe.dc.sources.U.vl;const f=olympe.dc.sources.U.ji,g=olympe.dc.sources.U.hp,h=olympe.dc.sources.U.ul;let k;e=`${Fi(a,null!=d?d:b,g)?'https':'http'}://${Fi(a,null!=d?d:b,e)}:${null!=(k=Fi(a,null!=d?d:b,f))?k:Fi(a,null!=d?d:b,g)?443:80}`+`/${Fi(a,null!=d?d:b,h)}/${b}`.replace(/\/+/g,'/').replace(/\/$/,'');a.O.set(b,e)}return`${e}/${c}`}
716
+ function Ii(a,b){return b instanceof olympe.net.li?Bd(a.K,b,gd(a.Z).wd()):Promise.reject('No http request to send')}function Ji(a,b){var c=Hi(a,b.pc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the query to destination: ${b.pc()}`);const d=b.content,e=JSON.stringify(a.F.ha(d));c=N(c,ri,e);oc(c,{['X-Source-Origin']:b.origin,[ui]:'application/json'});return Ii(a,c).then(f=>'string'===typeof f?a.F.O(JSON.parse(f)):olympe.dc.query.td.Ti(d))}
717
717
  function Ki(a,b){var c=Hi(a,b.pc(),b.getType());if(!c)return Promise.reject(`No destination URL to send the transaction to destination: ${b.pc()}`);const d=JSON.stringify(a.F.ha(b.content));c=N(c,ri,d);oc(c,{['X-Source-Origin']:b.origin,[ui]:'application/json'});return Ii(a,c).then(e=>Number.parseInt(e,10))}function Ci(a,b){return'string'!==typeof b?Promise.reject('Please provide an authorization token.'):new Promise((c,d)=>{a.Z.Ug(b,(e,f)=>{e?d(e):c(f)})})}
718
- olympe.dc.sources.pt=class{constructor(a,b,c,d,e,f){this.H=a;this.T=b;this.J=c;this.Z=d;this.aa=e;this.F=f;this.G=new Map;new olympe.D.Zb('Http service of remote data provider');this.O=new Map;this.C=new Map;this.ea=new Map([[olympe.dc.Request.C.qg,olympe.N.ac.qg],[olympe.dc.Request.C.Of,olympe.N.ac.xj],[olympe.dc.Request.C.Xf,olympe.N.ac.xj],[olympe.dc.Request.C.og,olympe.N.ac.xj],[olympe.dc.Request.C.Fn,olympe.N.ac.En],[olympe.dc.Request.C.Aq,olympe.N.ac.zq],[olympe.dc.Request.C.Zo,olympe.N.ac.Yo],
718
+ olympe.dc.sources.qt=class{constructor(a,b,c,d,e,f){this.H=a;this.T=b;this.K=c;this.Z=d;this.aa=e;this.F=f;this.G=new Map;new olympe.D.Zb('Http service of remote data provider');this.O=new Map;this.C=new Map;this.ea=new Map([[olympe.dc.Request.C.qg,olympe.N.ac.qg],[olympe.dc.Request.C.Pf,olympe.N.ac.xj],[olympe.dc.Request.C.Xf,olympe.N.ac.xj],[olympe.dc.Request.C.og,olympe.N.ac.xj],[olympe.dc.Request.C.Fn,olympe.N.ac.En],[olympe.dc.Request.C.Bq,olympe.N.ac.Aq],[olympe.dc.Request.C.Zo,olympe.N.ac.Yo],
719
719
  [olympe.dc.Request.C.yg,olympe.N.ac.Tn],[olympe.dc.Request.C.Ig,olympe.N.ac.TRANSACTION]])}Hc(a){var b=Hi(this,a.pc(),a.getType());if(!b)return Promise.reject(`No destination URL to send the status request to destination: ${a.pc()}`);b=N(b,qi);oc(b,{['X-Source-Origin']:a.origin});return Ii(this,b)}uploadFileContent(a){const {tag:b,model:c,content:d}=a.content,e=a.pc(),f=Hi(this,e,a.getType());if(!f)return Promise.reject(`No destination URL to upload the file. ${b}`);const g=N(e===olympe.dc.Qa.SERVER?
720
720
  `${f}/${b}`:`${f}?tag=${b}&model=${c}`,ti,d);oc(g,{[ui]:'application/octet-stream'});e!==olympe.dc.Qa.SERVER&&oc(g,{['X-Source-Origin']:a.origin});return Ii(this,g).then(()=>(new URL(g.C())).pathname)}deleteFileContent(a){const {tag:b,model:c}=a.content,d=a.pc();var e=Hi(this,d,a.getType());if(!e)return Promise.reject(`No destination URL to delete the file. ${b}`);e=N(d===olympe.dc.Qa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,si,b);d!==olympe.dc.Qa.SERVER&&oc(e,{['X-Source-Origin']:a.origin});
721
- return Ii(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.pc();var e=Hi(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.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,Lh:k})});if(this.C.has(b))return f;this.C.set(b,g);e=N(d===olympe.dc.Qa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,qi,b,olympe.net.Ba.ResponseType.Ji);d!==olympe.dc.Qa.SERVER&&oc(e,{['X-Source-Origin']:a.origin});Ii(this,
722
- e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.Lh(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.pp=class{constructor(a,b){this.H=a;this.Yb=b}};olympe.dc.sources.pp.$b={Di:0,qB:1,rB:3,NA:4};const Li=olympe.dc.Request.C.Lb,Mi=olympe.dc.Request.C.yg,Ni=olympe.dc.Request.C.Rj,Oi=olympe.dc.Request.C.Xf,Pi=olympe.dc.Request.C.Of,Qi=olympe.dc.Request.C.og,Ri=olympe.dc.Request.C.$h,Si=olympe.dc.Request.C.ah,Ti=olympe.dc.Request.C.Ve,Ui=olympe.dc.Request.C.Ig;
723
- function Vi(a,b){const c=b.V();null===a.F&&(a.F=new olympe.Y.Ah(6E4),Ya(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Za(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.xc(c);b.Uc(e);Wa(a.F.C,c)||a.F.set(c,e)}
724
- function Wi(a,b){const c=b.V();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.xc(c);let g;null==(g=a.F)||g.delete(c);b.Uc(f);return a.applyTransaction(f,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Xi(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b));return 0<a.T?rxjs.interval(a.T).pipe(rxjs.operators.switchMap(()=>c)):c}
725
- olympe.dc.sources.Ep=class{constructor(a,b){this.H=a;this.C=b;this.Yb=null;this.O=olympe.dc.query.wk();this.J=olympe.dc.Ir();this.G=new olympe.D.Zb('Context of source '+this.V());let c;this.T=null!=(c=b.Fe(olympe.dc.sources.U.Vl))?c:-1;this.F=null}V(){return this.C.V()}init(a){this.Yb=a;if(this.V()===olympe.dc.Qa.SELF)return this;(new Promise((b,c)=>{let d=!0;Yi(this.C,this.G).subscribe(rxjs.Subscriber.create(e=>{if(this.H.C()){this.H.debug(`Data source ${this.C.name()} has loaded ${e.size()} data types in its cache:`);
726
- for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.V()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.V()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Li:const d=olympe.dm.DataSource.Lb.zb,e=olympe.dm.DataSource.Lb.vh;
727
- return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case Mi:return this.C.executeQuery(b);case Ri:return c=b.uc(),Vi(this,c),this.J.wc($e(c)),Promise.resolve();case Ti:case Ui:const f=b.uc();return this.applyTransaction(f,c===Ui).finally(()=>{if(a.origin===olympe.dc.Qa.SELF){var g=f.V();g=df(new olympe.dc.Request(olympe.dc.Request.C.yj,olympe.dc.Qa.SELF,{id:g,finalize:olympe.dc.transaction.sf.C.vi,error:null}),this.V());let h;null==(h=this.Yb)||h.qd(g)}});case Si:return Wi(this,
728
- b.uc());case Oi:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Pi:return this.C.downloadFileContent(b.tag,b.model);case Qi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}ea(a){if(a.getType()===Ni){const b=a.content;a=a.origin;return a===olympe.dc.Qa.SELF?Xi(this,b):Mh(this.O,
729
- b,this.G,a,olympe.dc.pa.$c.Lf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Ge)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>$e(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){var d=Zi(a);yield c.C.applyTransaction(d,{batch:b});d=Date.now();yield Vh(c.O,c.V(),a);c.J.wc($e(a,d));return d})}};olympe.dc.sources.Ep.ya=[olympe.dc.sources.uj];function Zi(a){const b=olympe.dc.sources.Vf.C.Ns,c=olympe.dc.sources.Vf.C.Cv,d=olympe.dc.sources.Vf.C.Ts,e=olympe.dc.sources.Vf.C.Os,f=olympe.dc.sources.Vf.C.Us,g=[],h=[],k=[],l=[],n=[];a.C.forEach((p,q)=>{const r=p.Wb();p.F()?g.push($i(b,q,r,p.T()?p.Cb():null)):p.yd()?k.push($i(d,q,r,null,p.J())):p.T()&&h.push($i(c,q,r,p.Cb()));for(const [t,u,x]of p.xd())p=a.Lc(u),x?l.push(new aj(e,t,q,u,r,p.Wb())):n.push(new aj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
721
+ return Ii(this,e).then()}downloadFileContent(a){const {tag:b,model:c}=a.content,d=a.pc();var e=Hi(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.C.get(b))?f:[];f=new Promise((h,k)=>{g.push({done:h,Mh:k})});if(this.C.has(b))return f;this.C.set(b,g);e=N(d===olympe.dc.Qa.SERVER?`${e}/${b}`:`${e}?tag=${b}&model=${c}`,qi,b,olympe.net.Ba.ResponseType.Ji);d!==olympe.dc.Qa.SERVER&&oc(e,{['X-Source-Origin']:a.origin});Ii(this,
722
+ e).then(h=>{const k=h instanceof ArrayBuffer?new Uint8Array(h,0,h.byteLength):h;let l;null==(l=this.C.get(b))||l.forEach(n=>n.done(k))}).catch(h=>{let k;null==(k=this.C.get(b))||k.forEach(l=>l.Mh(`${h}`))}).finally(()=>{this.C.delete(b)});return f}};olympe.dc.sources.qp=class{constructor(a,b){this.H=a;this.Yb=b}};olympe.dc.sources.qp.$b={Di:0,rB:1,sB:3,OA:4};const Li=olympe.dc.Request.C.Lb,Mi=olympe.dc.Request.C.yg,Ni=olympe.dc.Request.C.Rj,Oi=olympe.dc.Request.C.Xf,Pi=olympe.dc.Request.C.Pf,Qi=olympe.dc.Request.C.og,Ri=olympe.dc.Request.C.ai,Si=olympe.dc.Request.C.ah,Ti=olympe.dc.Request.C.Ve,Ui=olympe.dc.Request.C.Ig;
723
+ function Vi(a,b){const c=b.V();null===a.F&&(a.F=new olympe.Y.Bh(6E4),Ya(a.F,(f,g)=>{a.applyTransaction(g,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${f} to the data source: ${h}`)})}),Za(a.F,()=>{a.F=null}));let d;const e=null!=(d=a.F.get(c))?d:new olympe.dc.db.uc(c);b.Kc(e);Wa(a.F.C,c)||a.F.set(c,e)}
724
+ function Wi(a,b){const c=b.V();let d,e;const f=null!=(e=null==(d=a.F)?void 0:d.get(c))?e:new olympe.dc.db.uc(c);let g;null==(g=a.F)||g.delete(c);b.Kc(f);return a.applyTransaction(f,!1).catch(h=>{a.H.error(`Error occurred when applying burst transaction ${c} to the data source: ${h}`)})}function Xi(a,b){const c=rxjs.defer(()=>a.C.executeQuery(b));return 0<a.T?rxjs.interval(a.T).pipe(rxjs.operators.switchMap(()=>c)):c}
725
+ olympe.dc.sources.Fp=class{constructor(a,b){this.H=a;this.C=b;this.Yb=null;this.O=olympe.dc.query.wk();this.K=olympe.dc.Jr();this.G=new olympe.D.Zb('Context of source '+this.V());let c;this.T=null!=(c=b.Fe(olympe.dc.sources.U.Vl))?c:-1;this.F=null}V(){return this.C.V()}init(a){this.Yb=a;if(this.V()===olympe.dc.Qa.SELF)return this;(new Promise((b,c)=>{let d=!0;Yi(this.C,this.G).subscribe(rxjs.Subscriber.create(e=>{if(this.H.C()){this.H.debug(`Data source ${this.C.name()} has loaded ${e.size()} data types in its cache:`);
726
+ for(const [f,g]of e)this.H.debug(`=> DataType: ${g.name()} (${f})`)}d&&(d=!1,b())},c))})).then(()=>this.C.init(this.G)).catch(b=>{this.H.error(`Error while initialization of DataSource ${this.C.name()} (${this.V()}): ${b}`)});return this}healthCheck(){return this.C.healthCheck().then(()=>`Data source ${this.C.name()} (${this.C.V()}) OK`)}destroy(){this.G.destroy();return this.C.destroy()}request(a){const b=a.content;var c=a.getType();switch(c){case Li:const d=olympe.dm.DataSource.Lb.zb,e=olympe.dm.DataSource.Lb.wh;
727
+ return this.C.healthCheck().then(()=>({s:e})).catch(g=>({s:d,r:String(g)}));case Mi:return this.C.executeQuery(b);case Ri:return c=b.rc(),Vi(this,c),this.K.yc($e(c)),Promise.resolve();case Ti:case Ui:const f=b.rc();return this.applyTransaction(f,c===Ui).finally(()=>{if(a.origin===olympe.dc.Qa.SELF){var g=f.V();g=df(new olympe.dc.Request(olympe.dc.Request.C.yj,olympe.dc.Qa.SELF,{id:g,finalize:olympe.dc.transaction.tf.C.wi,error:null}),this.V());let h;null==(h=this.Yb)||h.qd(g)}});case Si:return Wi(this,
728
+ b.rc());case Oi:return b.content instanceof Uint8Array?this.C.uploadFileContent(b.tag,b.model,b.content).then(()=>`datasource://${b.tag}`):Promise.reject('File content is undefined');case Pi:return this.C.downloadFileContent(b.tag,b.model);case Qi:return this.C.deleteFileContent(b.tag,b.model);default:return Promise.reject(`Request of type ${a.getType()} is not supported by the data source`)}}ea(a){if(a.getType()===Ni){const b=a.content;a=a.origin;return a===olympe.dc.Qa.SELF?Xi(this,b):Mh(this.O,
729
+ b,this.G,a,olympe.dc.pa.$c.Mf,{}).pipe(rxjs.operators.map(c=>{let d,e;return null!=(e=null==(d=c.Ge)?void 0:d.G)?e:null}),rxjs.operators.filter(c=>null!==c),rxjs.operators.map(c=>$e(c,Date.now())))}return rxjs.throwError(()=>Error('Subscription request not supported'))}applyTransaction(a,b){const c=this;return v(function*(){var d=Zi(a);yield c.C.applyTransaction(d,{batch:b});d=Date.now();yield Vh(c.O,c.V(),a);c.K.yc($e(a,d));return d})}};olympe.dc.sources.Fp.ya=[olympe.dc.sources.uj];function Zi(a){const b=olympe.dc.sources.Vf.C.Os,c=olympe.dc.sources.Vf.C.Dv,d=olympe.dc.sources.Vf.C.Us,e=olympe.dc.sources.Vf.C.Ps,f=olympe.dc.sources.Vf.C.Vs,g=[],h=[],k=[],l=[],n=[];a.C.forEach((p,q)=>{const r=p.Wb();p.F()?g.push($i(b,q,r,p.T()?p.Cb():null)):p.yd()?k.push($i(d,q,r,null,p.K())):p.T()&&h.push($i(c,q,r,p.Cb()));for(const [t,u,x]of p.xd())p=a.Mc(u),x?l.push(new aj(e,t,q,u,r,p.Wb())):n.push(new aj(f,t,q,u,r,p.Wb()))});return n.concat(k,g,h,l)}
730
730
  function $i(a,b,c,d,e){if('string'!==typeof c)throw Error(`Patch: model of instance ${b} is missing. It is invalid transaction.`);return new bj(a,b,c,d,e)}olympe.dc.sources.Vf=class{constructor(a){this.type=a}};class bj extends olympe.dc.sources.Vf{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.Ob.NONE}}
731
- class aj extends olympe.dc.sources.Vf{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.Vf.C={Ns:'CREATE',Cv:'UPDATE',Ts:'DELETE',Os:'CREATE_RELATION',Us:'DELETE_RELATION'};function cj(a,b){b=df(new olympe.dc.Request(olympe.dc.Request.C.yj,olympe.dc.Qa.SELF,{id:b,finalize:olympe.dc.transaction.sf.C.vi,error:null}),a.V());let c;null==(c=a.Yb)||c.qd(b)}
732
- olympe.dc.sources.cl=class{constructor(a,b){this.H=a;this.F=b;this.Yb=null}V(){}T(){}Z(){}init(a){this.Yb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return v(function*(){if(!b.F.F)return b.T(a);var c=olympe.dc.Request.C.Lb,d=olympe.dc.Request.C.yg;const e=olympe.dc.Request.C.Ve,f=olympe.dc.Request.C.Ig;var g=olympe.dc.Request.C.$h;const h=olympe.dc.Request.C.ah,k=olympe.dc.Request.C.Xf;var l=olympe.dc.Request.C.Of;const n=olympe.dc.Request.C.og,p=olympe.dc.sources.Vd(),
733
- q=a.getType();var r=a.pc();if(dd(b.F)){q===d&&(c=a.content,(g=ff(a).get(olympe.dc.pa.C.Yk))&&(yield dj(p,c.V(),g)),b.H.debug(`Data Provider: Query ${c.V()} 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.T(a);if(q===d)d=a.content,yield ej(p,d.V(),r,l.uc(),!0),b.H.C()&&b.H.debug(`Data Provider: Data result for query ${d.V()}`,l.uc().C.size,'instances',
734
- Array.from(l.uc().xd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield ej(p,null,r,a.content.uc(),!1);return l}b.H.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.Lb.de};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.uc().V();return p.applyTransaction(d,r).finally(()=>
731
+ class aj extends olympe.dc.sources.Vf{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.Vf.C={Os:'CREATE',Dv:'UPDATE',Us:'DELETE',Ps:'CREATE_RELATION',Vs:'DELETE_RELATION'};function cj(a,b){b=df(new olympe.dc.Request(olympe.dc.Request.C.yj,olympe.dc.Qa.SELF,{id:b,finalize:olympe.dc.transaction.tf.C.wi,error:null}),a.V());let c;null==(c=a.Yb)||c.qd(b)}
732
+ olympe.dc.sources.cl=class{constructor(a,b){this.H=a;this.F=b;this.Yb=null}V(){}T(){}Z(){}init(a){this.Yb=a;return this}destroy(){return Promise.resolve()}request(a){const b=this;return v(function*(){if(!b.F.F)return b.T(a);var c=olympe.dc.Request.C.Lb,d=olympe.dc.Request.C.yg;const e=olympe.dc.Request.C.Ve,f=olympe.dc.Request.C.Ig;var g=olympe.dc.Request.C.ai;const h=olympe.dc.Request.C.ah,k=olympe.dc.Request.C.Xf;var l=olympe.dc.Request.C.Pf;const n=olympe.dc.Request.C.og,p=olympe.dc.sources.Vd(),
733
+ q=a.getType();var r=a.pc();if(dd(b.F)){q===d&&(c=a.content,(g=ff(a).get(olympe.dc.pa.C.Yk))&&(yield dj(p,c.V(),g)),b.H.debug(`Data Provider: Query ${c.V()} 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.T(a);if(q===d)d=a.content,yield ej(p,d.V(),r,l.rc(),!0),b.H.C()&&b.H.debug(`Data Provider: Data result for query ${d.V()}`,l.rc().C.size,'instances',
734
+ Array.from(l.rc().xd()).length,'relations');else if(q===e||q===f||q===h)b.H.debug('Data Provider: Persisting graph patch in offline cache after successful transaction'),yield ej(p,null,r,a.content.rc(),!1);return l}b.H.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.Lb.de};case d:return p.executeQuery(a.content);case e:case f:case h:d=a.content;const t=d.rc().V();return p.applyTransaction(d,r).finally(()=>
735
735
  cj(b,t));case g:return Promise.resolve();case k:return r=a.content,p.uploadFileContent(r.tag,r.content,r.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.V()}`)}})}ea(a,b){if(!this.F.F)return this.Z(a,b);const c=olympe.dc.sources.Vd(),d=a.content,e=a.pc();return rxjs.of(null).pipe(rxjs.operators.switchMap(()=>{if(dd(this.F)){const f=new rxjs.Observable(h=>
736
- {olympe.D.ds([this.F.cg()],()=>{h.error(new olympe.N.errors.bp('Go Offline',d.V()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.D.ds([this.F.cg()],()=>{f.error(new olympe.N.errors.Rn('Back Online',d.V()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(ej(c,d.V(),e,f).then(()=>f).catch(g=>{this.H.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.cl.ya=[olympe.dc.sources.uj];const fj=olympe.dc.Request.C.Lb,gj=olympe.dc.Request.C.yg,hj=olympe.dc.Request.C.Rj,ij=olympe.dc.Request.C.Ve,jj=olympe.dc.Request.C.Ig,kj=olympe.dc.Request.C.$h,lj=olympe.dc.Request.C.ah,mj=olympe.dc.Request.C.Xf,nj=olympe.dc.Request.C.Of,oj=olympe.dc.Request.C.og;function pj(a,b){let c;return(null==(c=a.ua.sb(b))?void 0:c.Fe(olympe.dc.sources.U.Ke))!==olympe.dm.DataSource.Ke.cp}function qj(a,b){let c;return(null==(c=a.ua.sb(b))?void 0:c.Fe(olympe.dc.sources.U.Ke))!==olympe.dm.DataSource.Ke.In}
737
- function rj(a,b){b=b.Ac();if(b!==olympe.dm.User.C&&a.Fe(olympe.dc.sources.U.cm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.V()}). Please use an admin account instead.`,new olympe.dc.sources.Iq(a);}
738
- function sj(a,b,c,d,e){return v(function*(){var f=olympe.N.cb.C.SEND,g=olympe.N.cb.C.GET;const h=olympe.N.cb.C.PUBLISH,k=olympe.N.cb.C.SUBSCRIBE,l=d.es();var n=d.body();if(e!==n.Ac())throw Error('Access denied: try to impersonate a user');rj(c,n);let p;if(null==(p=a.Yb)||!p.sources.has(n.pc()))throw Error(`Try to process a message with destination data source ${n.pc()} coming from remote but not started here`);if(l===k){if(n.getType()===hj)f=n.content.V();else throw Error('Not supported type of subscription');
739
- g=yield d.cn(f);a.aa.set(g,f);g=a.O.get(f);g||(g=new tj(a.H,f,b,df(n,olympe.dc.Qa.qf)),a.O.set(f,g));n=g;n.C++;n.H.debug(`Data subscription ${n.F} has ${n.C} subscribers`)}else l===g?(n=yield b.request(n),void 0!==n?yield d.qd(n):a.H.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.ur()):l===h&&(yield b.request(n))})}
740
- olympe.dc.sources.Hq=class extends olympe.dc.sources.cl{constructor(a,b,c,d,e,f){super(a,d);this.J=b;this.C=c;this.db=e;this.G=new olympe.D.Zb('Remote Provider Context');this.ka=new Map;this.O=new Map;this.aa=new Map;this.ua=f}V(){return olympe.dc.Qa.qf}T(a){var b=olympe.N.yb;const c=a.pc(),d=a.getType();this.H.C()&&this.H.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case fj:const e=olympe.dm.DataSource.Lb.zb,f=olympe.dm.DataSource.Lb.vh;b=pj(this,
741
- c)?b.get(c,a):Promise.resolve({s:f});a=qj(this,c)?this.C.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 gj:return qj(this,c)?Ji(this.C,a):b.get(c,a);case ij:const g=a.content.uc().V();return(pj(this,c)?b.get(c,a):Ki(this.C,a)).finally(()=>cj(this,g));case jj:const h=a.content.uc().V();return(qj(this,c)?Ki(this.C,
736
+ {olympe.D.es([this.F.cg()],()=>{h.error(new olympe.N.errors.bp('Go Offline',d.V()))})}),g=this.Z(a,b);return rxjs.merge(f,g)}return new rxjs.Observable(f=>{olympe.D.es([this.F.cg()],()=>{f.error(new olympe.N.errors.Rn('Back Online',d.V()))})})})).pipe(rxjs.operators.switchMap(f=>rxjs.from(ej(c,d.V(),e,f.rc()).then(()=>f).catch(g=>{this.H.error(`Data Provider: Cache database failed to handle the data result with message: ${g}`);throw g;}))))}};olympe.dc.sources.cl.ya=[olympe.dc.sources.uj];const fj=olympe.dc.Request.C.Lb,gj=olympe.dc.Request.C.yg,hj=olympe.dc.Request.C.Rj,ij=olympe.dc.Request.C.Ve,jj=olympe.dc.Request.C.Ig,kj=olympe.dc.Request.C.ai,lj=olympe.dc.Request.C.ah,mj=olympe.dc.Request.C.Xf,nj=olympe.dc.Request.C.Pf,oj=olympe.dc.Request.C.og;function pj(a,b){let c;return(null==(c=a.ua.sb(b))?void 0:c.Fe(olympe.dc.sources.U.Ke))!==olympe.dm.DataSource.Ke.cp}function qj(a,b){let c;return(null==(c=a.ua.sb(b))?void 0:c.Fe(olympe.dc.sources.U.Ke))!==olympe.dm.DataSource.Ke.In}
737
+ function rj(a,b){b=b.Bc();if(b!==olympe.dm.User.C&&a.Fe(olympe.dc.sources.U.cm))throw a=`User ${b} has no right to access the restricted data source ${a.name()} (${a.V()}). Please use an admin account instead.`,new olympe.dc.sources.Jq(a);}
738
+ function sj(a,b,c,d,e){return v(function*(){var f=olympe.N.cb.C.SEND,g=olympe.N.cb.C.GET;const h=olympe.N.cb.C.PUBLISH,k=olympe.N.cb.C.SUBSCRIBE,l=d.gs();var n=d.body();if(e!==n.Bc())throw Error('Access denied: try to impersonate a user');rj(c,n);let p;if(null==(p=a.Yb)||!p.sources.has(n.pc()))throw Error(`Try to process a message with destination data source ${n.pc()} coming from remote but not started here`);if(l===k){if(n.getType()===hj)f=n.content.V();else throw Error('Not supported type of subscription');
739
+ g=yield d.cn(f);a.aa.set(g,f);g=a.O.get(f);g||(g=new tj(a.H,f,b,df(n,olympe.dc.Qa.rf)),a.O.set(f,g));n=g;n.C++;n.H.debug(`Data subscription ${n.F} has ${n.C} subscribers`)}else l===g?(n=yield b.request(n),void 0!==n?yield d.qd(n):a.H.warn(`Request from ${d.source()} requires an output value, but got undefined instead.`)):l===f?(yield b.request(n),yield d.vr()):l===h&&(yield b.request(n))})}
740
+ olympe.dc.sources.Iq=class extends olympe.dc.sources.cl{constructor(a,b,c,d,e,f){super(a,d);this.K=b;this.C=c;this.db=e;this.G=new olympe.D.Zb('Remote Provider Context');this.ka=new Map;this.O=new Map;this.aa=new Map;this.ua=f}V(){return olympe.dc.Qa.rf}T(a){var b=olympe.N.yb;const c=a.pc(),d=a.getType();this.H.C()&&this.H.debug(`Request (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);switch(d){case fj:const e=olympe.dm.DataSource.Lb.zb,f=olympe.dm.DataSource.Lb.wh;b=pj(this,
741
+ c)?b.get(c,a):Promise.resolve({s:f});a=qj(this,c)?this.C.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 gj:return qj(this,c)?Ji(this.C,a):b.get(c,a);case ij:const g=a.content.rc().V();return(pj(this,c)?b.get(c,a):Ki(this.C,a)).finally(()=>cj(this,g));case jj:const h=a.content.rc().V();return(qj(this,c)?Ki(this.C,
742
742
  a):b.get(c,a)).finally(()=>cj(this,h));case kj:return pj(this,c)?b.publish(c,a).catch(k=>{this.H.error(`An error occurred while sending "burst transaction" to the data source ${c}: ${k}`)}):Promise.resolve();case lj:return pj(this,c)?b.get(c,a):Ki(this.C,a);case mj:return qj(this,c)?this.C.uploadFileContent(a):b.get(c,a);case nj:return qj(this,c)?this.C.downloadFileContent(a):b.get(c,a);case oj:return qj(this,c)?this.C.deleteFileContent(a):b.send(c,a);default:return Promise.reject(`Messages of type ${a.getType()} is not supported by the source ${this.V()}`)}}Z(a,
743
- b){const c=a.pc(),d=a.getType();if(!pj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.H.C()&&this.H.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===hj?olympe.N.yb.observe(c,this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.pa.from(this.J,this.J).fb(olympe.dm.DataSource.dj).filter(olympe.dc.query.Aa.Ga(olympe.dm.DataSource.Gh,
744
- !0)).filter(olympe.dc.query.Aa.Ga(olympe.dm.DataSource.Er,!0)).observe(this.G).subscribe(b=>{jf(b).forEach(this.ab.bind(this,a));hf(b).forEach(c=>{let d;null==(d=this.ka.get(c))||d.destroy();this.ka.delete(c)})});this.db.Ra(this.J,olympe.dm.DataSource.Er)&&(new olympe.N.yb(this.J,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.qd(b):this.H.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}ab(a,b){const c=
745
- b.X(),d=new olympe.D.Zb(`Published data provider context ${c}`,this.G);this.ka.set(c,d);let e,f;uj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ke.In&&(e=Ei(this.C,c,l=>{rj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ke.cp&&(g=new olympe.D.Zb(`Bus Service of data source ${c}`,d),f=(new olympe.N.yb(c,g)).ks(this.Fa.bind(this)),f.listen().subscribe(l=>{l.Wh().then(n=>sj(this,a,b,l,n)).catch(n=>
746
- {this.H.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Lh(n instanceof Error?n:Error(n))})}))})}Fa(a){const b=this.aa.get(a);this.aa.delete(a);if(a=b)null==(a=this.O.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.H.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),a.G.unsubscribe(),a=!0):(a.H.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};
747
- class tj{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=kf(c,d).subscribe({next:e=>{olympe.N.yb.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}`)})}}olympe.dc.sources.Hq.ya=[olympe.dc.sources.uj];const Y={mr:10,Xn:11,Io:12,qq:13,QUERY_RESULT:14,$o:15,po:16,Ve:17,rq:18,oo:19,am:20};function vj(a,b){b=b.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,a.C(g)])));c.Vc(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ha(f.r,d.t,f.d));return c},new olympe.dc.db.xc);a.aa.wc($e(b))}
748
- olympe.dc.sources.fc=class extends olympe.N.fc{constructor(a){super();this.aa=a;this.db=a.view;this.G=new Map}ha(a){a=super.ha(a);if(0<this.G.size){const b=Array.from(this.G.values());this.G.clear();return Object.assign(Q(Y.mr,a),{i:b})}return a}J(a){return(null==a?void 0:a.t)===Y.mr&&Array.isArray(null==a?void 0:a.i)?(vj(this,a.i),this.C(a.v)):this.C(a)}F(a){switch(!0){case a instanceof olympe.dm.File:var b=Y.Io;{const c=a.X(),d={t:c};if(!this.G.has(c)&&(this.O(c),!this.db.Gf(c))){const e=a.get(olympe.dm.File.urlProp);
749
- if(e.startsWith('blob:')||e.startsWith('stream:'))a=olympe.dc.Mr().ua(a),this.G.get(c).p[olympe.dm.File.urlProp.X()]='stream://'+c,d.s=this.F(a)}a=d}return Q(b,a);case a instanceof olympe.dc.CloudObject:return Q(Y.Xn,this.O(a.X()));case a instanceof olympe.dc.pa:return Q(Y.qq,a.ha());case a instanceof olympe.dc.Pa:return Q(Y.QUERY_RESULT,a.ha(this.O.bind(this)));case a instanceof olympe.dc.db.xc:return b=new olympe.dc.transaction.Tf,a.Uc(b),Q(Y.$o,{i:a.V(),p:nf(b)});case a instanceof olympe.dc.Request:return Q(Y.po,
750
- {r:a.getType(),o:a.origin,d:a.pc(),u:a.Ac(),c:this.F(a.content)});case a instanceof olympe.dc.transaction.Hi:return Q(Y.Ve,{r:a.Xg(),p:this.F(a.uc())});case a instanceof olympe.dc.query.td:return Q(Y.rq,a.ha());case a instanceof olympe.dc.hh:return Q(Y.oo,a.ha());case a instanceof olympe.dc.Fc:return Q(Y.am,this.O(a.X()));default:return super.F(a)}}C(a){if(null===a||'object'!==typeof a)return super.C(a);const {t:b,v:c}=a;switch(b){case Y.Io:var d=c.t;c.s&&(a=this.C(c.s),olympe.dc.Mr().kb(d,a));return olympe.dc.CloudObject.get(d);
751
- case Y.Xn:return olympe.dc.CloudObject.get(c);case Y.qq:return d=c.p.map(olympe.dc.query.ta.Zl.C),a=c.e,new olympe.dc.pa(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ed:a.s,He:a.rm});case Y.QUERY_RESULT:return Xh(c);case Y.$o:return(new olympe.dc.transaction.zi).C(c.p,c.i);case Y.po:return a=null!=(d=this.C(c.c))?d:void 0,df(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case Y.Ve:return d=this.C(c.p),new olympe.dc.transaction.Hi(d,c.r);case Y.rq:return olympe.dc.query.td.C(c);case Y.oo:return olympe.dc.hh.C(c);
752
- case Y.am:return new olympe.dc.Fc(c);default:return super.C(a)}}O(a){if(this.G.has(a))return a;if(!this.db.Ia(a))throw new olympe.dc.$p(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.F(d)});const c=[];for(const [d,e,f]of Ig(this.db,a))this.G.has(f)&&c.push(e===olympe.dc.wa.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,d:a});this.G.set(a,{t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c});return a}};const wj=olympe.dc.Request.C.qg,xj=olympe.dc.Request.C.Ve,yj=olympe.dc.Request.C.Ig,zj=olympe.dc.Request.C.$h,Aj=olympe.dc.Request.C.Fn,Bj=olympe.dc.Request.C.Aq,Cj=olympe.dc.Request.C.yg,Dj=olympe.dc.Request.C.Rj,Ej=olympe.dc.Request.C.Zo,Fj=olympe.dc.Request.C.kt,Gj=olympe.dc.Request.C.lt,Hj=olympe.dc.Request.C.mt,Ij=olympe.dc.Request.C.og,Jj=olympe.dc.Request.C.Of,Kj=olympe.dc.Request.C.Xf,Lj=olympe.dc.Request.C.yj,Mj=olympe.dc.Request.C.Av,Nj=olympe.dc.Request.C.Ru,Oj=olympe.dc.Request.C.Uo,Pj=
753
- olympe.dc.Request.C.ah,Qj=olympe.dc.Request.C.Is,Rj=olympe.dc.Request.C.Lb;function Sj(a){return Tj(a,olympe.dc.Request.C.qg).then(b=>{b=b.p;const c=mf(b,a.V());a.H.C()&&a.H.debug('< Get Context result',b);a.H.O()&&a.H.log('< Get Context result has',b.length,'operations');return c})}function Uj(a,b){const c=new olympe.dc.transaction.Tf({fe:!1,Hh:!1}),d=b.uc();d.Uc(c);return Vj(a,xj,{i:d.V(),r:b.Xg(),p:nf(c)}).then(e=>e.ct)}
754
- function Wj(a,b){const c=b.uc();b=new olympe.dc.transaction.Tf({Ik:!0,fe:!1,Hh:!1});c.Uc(b);return Tj(a,yj,nf(b)).then(d=>d.ct).finally(()=>{Xj(a,Lj,{id:c.V(),finalize:olympe.dc.transaction.sf.C.vi})})}function Yj(a,b){const c=new olympe.dc.transaction.Tf({fe:!1,Hh:!1}),d=b.uc();d.Uc(c);return Vj(a,zj,{i:d.V(),r:b.Xg(),p:nf(c)},!1).catch(e=>a.H.error(`Error while publishing burst transaction: ${e}`))}
755
- function Zj(a,b){const c=new olympe.dc.transaction.Tf({fe:!1,Hh:!1});b=b.uc();b.Uc(c);return Vj(a,Pj,{i:b.V(),p:nf(c)}).then(d=>d.ct)}function ak(a,b){const c=encodeURI(Ta(olympe.Y.Ye(),JSON.stringify(bk(a,b))));a.H.C()&&a.H.debug(`Static GraphDef query ${b} sent to orchestrator`);return Tj(a,Cj,void 0,`query=${c}&v=${a.version}`).then(d=>ck(a,d))}function dk(a,b){const c=b.V();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=bk(a,b);return Tj(a,Ej,b).then(d=>ck(a,d))}
743
+ b){const c=a.pc(),d=a.getType();if(!pj(this,c))return rxjs.throwError(()=>Error(`Subscription request not supported for data source ${this.db.name(c)} (${c}) which uses HTTP only.`));this.H.C()&&this.H.debug(`Subscription (type: ${d}) will be sent to remote data provider ${c}: ${a.content}`);return d===hj?olympe.N.yb.observe(c,this.G,a,{onRetry:b}):rxjs.throwError(()=>Error(`Do not handle subscription request of type ${d}`))}init(a){super.init(a);if(a.G)return this;olympe.dc.pa.from(this.K,this.K).gb(olympe.dm.DataSource.dj).filter(olympe.dc.query.Aa.Ga(olympe.dm.DataSource.Hh,
744
+ !0)).filter(olympe.dc.query.Aa.Ga(olympe.dm.DataSource.Fr,!0)).observe(this.G).subscribe(b=>{jf(b).forEach(this.ab.bind(this,a));hf(b).forEach(c=>{let d;null==(d=this.ka.get(c))||d.destroy();this.ka.delete(c)})});this.db.Ra(this.K,olympe.dm.DataSource.Fr)&&(new olympe.N.yb(this.K,this.G)).listen().subscribe(b=>{b=b.body();b instanceof olympe.dc.Request?a.qd(b):this.H.error('Self source received something else than a data request, ignore it.')});return this}destroy(){return v(function*(){})}ab(a,b){const c=
745
+ b.X(),d=new olympe.D.Zb(`Published data provider context ${c}`,this.G);this.ka.set(c,d);let e,f;uj(b,d).subscribe(g=>{let h;null==(h=e)||h();let k;null==(k=f)||k.stop();g!==olympe.dm.DataSource.Ke.In&&(e=Ei(this.C,c,l=>{rj(b,l);return a.request(l)}),d.onDestroy(()=>{let l;return null==(l=e)?void 0:l()}));g!==olympe.dm.DataSource.Ke.cp&&(g=new olympe.D.Zb(`Bus Service of data source ${c}`,d),f=(new olympe.N.yb(c,g)).ls(this.Fa.bind(this)),f.listen().subscribe(l=>{l.Xh().then(n=>sj(this,a,b,l,n)).catch(n=>
746
+ {this.H.warn(`Error occurred while processing request from ${l.source()}: ${n}`);return l.Mh(n instanceof Error?n:Error(n))})}))})}Fa(a){const b=this.aa.get(a);this.aa.delete(a);if(a=b)null==(a=this.O.get(b))?a=0:(0<a.C&&--a.C,0===a.C?(a.H.debug(`Data subscription ${a.F} has more subscriber: unsubscribe`),a.G.unsubscribe(),a=!0):(a.H.debug(`Data subscription ${a.F} has ${a.C} subscribers`),a=!1));a&&this.O.delete(b)}};
747
+ class tj{constructor(a,b,c,d){this.H=a;this.F=b;this.C=0;this.G=kf(c,d).subscribe({next:e=>{olympe.N.yb.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}`)})}}olympe.dc.sources.Iq.ya=[olympe.dc.sources.uj];const Y={nr:10,Xn:11,Io:12,rq:13,QUERY_RESULT:14,$o:15,po:16,Ve:17,sq:18,oo:19,am:20};function vj(a,b){b=b.reduce((c,d)=>{const e=new Map(Array.from(Object.entries(d.p).map(([f,g])=>[f,a.C(g)])));c.Vc(d.t,d.s,e,d.m);d.r.forEach(f=>c.Ha(f.r,d.t,f.d));return c},new olympe.dc.db.uc);a.aa.yc($e(b))}
748
+ olympe.dc.sources.fc=class extends olympe.N.fc{constructor(a){super();this.aa=a;this.db=a.view;this.G=new Map}ha(a){a=super.ha(a);if(0<this.G.size){const b=Array.from(this.G.values());this.G.clear();return Object.assign(Q(Y.nr,a),{i:b})}return a}O(a){return(null==a?void 0:a.t)===Y.nr&&Array.isArray(null==a?void 0:a.i)?(vj(this,a.i),this.C(a.v)):this.C(a)}F(a){switch(!0){case a instanceof olympe.dm.File:var b=Y.Io;{const c=a.X(),d={t:c};if(!this.G.has(c)&&(this.K(c),!this.db.Hf(c))){const e=a.get(olympe.dm.File.urlProp);
749
+ if(e.startsWith('blob:')||e.startsWith('stream:'))a=olympe.dc.Nr().ua(a),this.G.get(c).p[olympe.dm.File.urlProp.X()]='stream://'+c,d.s=this.F(a)}a=d}return Q(b,a);case a instanceof olympe.dc.CloudObject:return Q(Y.Xn,this.K(a.X()));case a instanceof olympe.dc.pa:return Q(Y.rq,a.ha());case a instanceof olympe.dc.Pa:return Q(Y.QUERY_RESULT,a.ha(this.K.bind(this)));case a instanceof olympe.dc.db.uc:return b=new olympe.dc.transaction.pf,a.Kc(b),Q(Y.$o,{i:a.V(),p:nf(b)});case a instanceof olympe.dc.Request:return Q(Y.po,
750
+ {r:a.getType(),o:a.origin,d:a.pc(),u:a.Bc(),c:this.F(a.content)});case a instanceof olympe.dc.transaction.Hi:return Q(Y.Ve,{r:a.Xg(),p:this.F(a.rc())});case a instanceof olympe.dc.query.td:return Q(Y.sq,a.ha());case a instanceof olympe.dc.hh:return Q(Y.oo,a.ha());case a instanceof olympe.dc.vc:return Q(Y.am,this.K(a.X()));default:return super.F(a)}}C(a){if(null===a||'object'!==typeof a)return super.C(a);const {t:b,v:c}=a;switch(b){case Y.Io:var d=c.t;c.s&&(a=this.C(c.s),olympe.dc.Nr().kb(d,a));return olympe.dc.CloudObject.get(d);
751
+ case Y.Xn:return olympe.dc.CloudObject.get(c);case Y.rq:return d=c.p.map(olympe.dc.query.ta.Zl.C),a=c.e,new olympe.dc.pa(c.b,c.s,d,d.length-1,new Set(c.r),{max:a.m,offset:a.o,Ed:a.s,He:a.rm});case Y.QUERY_RESULT:return Xh(c);case Y.$o:return(new olympe.dc.transaction.th).C(c.p,c.i);case Y.po:return a=null!=(d=this.C(c.c))?d:void 0,df(new olympe.dc.Request(c.r,c.d,a,c.u),c.o);case Y.Ve:return d=this.C(c.p),new olympe.dc.transaction.Hi(d,c.r);case Y.sq:return olympe.dc.query.td.C(c);case Y.oo:return olympe.dc.hh.C(c);
752
+ case Y.am:return new olympe.dc.vc(c);default:return super.C(a)}}K(a){if(this.G.has(a))return a;if(!this.db.Ia(a))throw new olympe.dc.aq(a);const b={};this.db.Cb(a).forEach((d,e)=>{b[e]=this.F(d)});const c=[];for(const [d,e,f]of Ig(this.db,a))this.G.has(f)&&c.push(e===olympe.dc.wa.DESTINATION?{r:d,o:a,d:f}:{r:d,o:f,d:a});this.G.set(a,{t:a,m:this.db.model(a),s:this.db.source(a),p:b,r:c});return a}};const wj=olympe.dc.Request.C.qg,xj=olympe.dc.Request.C.Ve,yj=olympe.dc.Request.C.Ig,zj=olympe.dc.Request.C.ai,Aj=olympe.dc.Request.C.Fn,Bj=olympe.dc.Request.C.Bq,Cj=olympe.dc.Request.C.yg,Dj=olympe.dc.Request.C.Rj,Ej=olympe.dc.Request.C.Zo,Fj=olympe.dc.Request.C.lt,Gj=olympe.dc.Request.C.mt,Hj=olympe.dc.Request.C.nt,Ij=olympe.dc.Request.C.og,Jj=olympe.dc.Request.C.Pf,Kj=olympe.dc.Request.C.Xf,Lj=olympe.dc.Request.C.yj,Mj=olympe.dc.Request.C.Bv,Nj=olympe.dc.Request.C.Su,Oj=olympe.dc.Request.C.Uo,Pj=
753
+ olympe.dc.Request.C.ah,Qj=olympe.dc.Request.C.Js,Rj=olympe.dc.Request.C.Lb;function Sj(a){return Tj(a,olympe.dc.Request.C.qg).then(b=>{b=b.p;const c=mf(b,a.V());a.H.C()&&a.H.debug('< Get Context result',b);a.H.T()&&a.H.log('< Get Context result has',b.length,'operations');return c})}function Uj(a,b){const c=new olympe.dc.transaction.pf({ee:!1,Ih:!1}),d=b.rc();d.Kc(c);return Vj(a,xj,{i:d.V(),r:b.Xg(),p:nf(c)}).then(e=>e.ct)}
754
+ function Wj(a,b){const c=b.rc();b=new olympe.dc.transaction.pf({Ik:!0,ee:!1,Ih:!1});c.Kc(b);return Tj(a,yj,nf(b)).then(d=>d.ct).finally(()=>{Xj(a,Lj,{id:c.V(),finalize:olympe.dc.transaction.tf.C.wi})})}function Yj(a,b){const c=new olympe.dc.transaction.pf({ee:!1,Ih:!1}),d=b.rc();d.Kc(c);return Vj(a,zj,{i:d.V(),r:b.Xg(),p:nf(c)},!1).catch(e=>a.H.error(`Error while publishing burst transaction: ${e}`))}
755
+ function Zj(a,b){const c=new olympe.dc.transaction.pf({ee:!1,Ih:!1});b=b.rc();b.Kc(c);return Vj(a,Pj,{i:b.V(),p:nf(c)}).then(d=>d.ct)}function ak(a,b){const c=encodeURI(Ta(olympe.Y.Ye(),JSON.stringify(bk(a,b))));a.H.C()&&a.H.debug(`Static GraphDef query ${b} sent to orchestrator`);return Tj(a,Cj,void 0,`query=${c}&v=${a.version}`).then(d=>ck(a,d))}function dk(a,b){const c=b.V();a.H.C()&&a.H.debug(`Query (${c}) sent to orchestrator: ${b}`);b=bk(a,b);return Tj(a,Ej,b).then(d=>ck(a,d))}
756
756
  function Vj(a,b,c,d=!0){const e=olympe.N.Pe.ng,f={c:b};Object.assign(f,c);if(d)return new Promise((g,h)=>{Kd(a.G,e,f,(k,l)=>{k?h(k):g(l)})});Kd(a.G,e,f);return Promise.resolve()}
757
- function bk(a,b){var c=uh(b);b={i:b.V(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ta.Rd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ga(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.C;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ta.ue&&k.G){let q;null==(q=e.get(k.V()))||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.C))?g:[];Object.assign(b,{f:olympe.dc.Ob.NONE,q:c.map(a.ka.bind(a,
757
+ function bk(a,b){var c=uh(b);b={i:b.V(),b:[b.F],m:!0,v:!0};if(c[0]instanceof olympe.dc.query.ta.Rd)Object.assign(b,{f:c[0].Pb,q:[]});else{const d=(h,k)=>{h.every(l=>!l.Ga(k))&&h.push(k);return h},e=new Map;for(let h=c.length-1;0<=h;h--){const k=c[h],l=k.C;let n;const p=d(null!=(n=e.get(l))?n:[],k);if(k instanceof olympe.dc.query.ta.te&&k.G){let q;null==(q=e.get(k.V()))||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.C))?g:[];Object.assign(b,{f:olympe.dc.Ob.NONE,q:c.map(a.ka.bind(a,
758
758
  e))})}return b}function Xj(a,b,c){b=df(new olympe.dc.Request(b,olympe.dc.Qa.SELF,c),a.V());let d;null==(d=a.Yb)||d.qd(b)}
759
- function Tj(a,b,c,d){const e=Hi(a.C,a.V(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Ba.Sd.th:olympe.net.Ba.Sd.GET,c&&JSON.stringify(c));oc(b,{[olympe.net.Ba.Headers.bi]:'application/json'});return Ii(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}
760
- function ck(a,b){if(!b||'object'!==typeof b)throw Error('Data result can be created only from Object');if(0<b.s)throw Error(b.error);return mf(b.p,a.V())}function ek(a,b,c){return v(function*(){const d=b.pi;let e;if(c instanceof olympe.Y.stream.Bg){e=new olympe.dc.db.xc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.aa.C(g.value.p,d).Uc(e)}}catch(f){a.H.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.xc(d)}}else e=a.aa.C(b.p,d);return $e(e,b.ct)})}
761
- olympe.dc.sources.Vq=class extends olympe.dc.sources.cl{constructor(a,b,c,d,e){super(a,c);this.G=b;this.C=d;this.aa=new olympe.dc.transaction.zi(this.V());this.J=new Map;this.O=new Set;this.version=e||'unknown';olympe.D.Zi(this.F.cg(),()=>{this.J.forEach((f,g)=>{f.error(new olympe.N.errors.Hj('Connection to server has been recovered',g))})})}V(){return olympe.dc.Qa.SERVER}T(a){var b=a.getType(),c=a.content,d=ff(a);switch(b){case Rj:return c=olympe.dm.DataSource.Lb.zb,a=olympe.dm.DataSource.Lb.vh,
762
- Promise.resolve(Fd(this.G)?{s:a}:{s:c,r:'Disconnected'});case wj:return Sj(this);case xj:return Uj(this,c);case yj:return Wj(this,c);case zj:return Yj(this,c);case Pj:return Zj(this,c);case Cj:return d.get(olympe.dc.pa.C.qp)?ak(this,c):dk(this,c);case Aj:return Fd(this.G)?(c=bk(this,olympe.dc.pa.from(c)),c.f=olympe.dc.Ob.vo,c=N(Hi(this.C,olympe.dc.Qa.SERVER,Aj),olympe.net.Ba.Sd.th,JSON.stringify(c),olympe.net.Ba.ResponseType.Ji),oc(c,{[olympe.net.Ba.Headers.bi]:olympe.net.Ba.fl.JSON}),c=Ii(this.C,
763
- c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Bj:return a=c.ZD,b=c.debug,c=c.optional,Fd(this.G)?(d=Hi(this.C,olympe.dc.Qa.SERVER,Bj),c=N(d+`?debug=${b}&optional=${c}`,olympe.net.Ba.Sd.th,a),oc(c,{[olympe.net.Ba.Headers.bi]:olympe.net.Ba.fl.Jv}),c=Ii(this.C,c)):(this.H.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected')),c;case Mj:case Nj:case Oj:case Qj:return Vj(this,
764
- b,{});case Jj:return this.C.downloadFileContent(a);case Ij:return this.C.deleteFileContent(a);case Kj:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Dj){const c=a.content,d=c.V();return(new rxjs.Observable(e=>{const f=bk(this,c);this.O.delete(d);this.J.set(d,e);Vj(this,Fj,f).catch(g=>e.error(g))})).pipe(db(olympe.N.errors.Hj,(e,f)=>{this.H.debug(`Subscribe to topic ${e.V()} now that we are back online, after waiting for ${f}ms`);
765
- b()}),rxjs.operators.finalize(()=>{this.O.add(d);Vj(this,Gj,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.O.has(d)&&this.J.delete(d);this.O.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Dd(this.G,olympe.N.Pe.ng,this.ua.bind(this));return this}destroy(){return v(function*(){})}ua(a,b){const c=olympe.dc.Request.C.Hn,d=olympe.dc.Request.C.Ll,e=a.c;if(e===olympe.dc.Request.C.lo)ek(this,
766
- a,b).then(f=>{Xj(this,e,f)});else if(e===c)b=this.aa.C(a.p,a.i),Xj(this,e,{rollback:$e(b,a.ct),error:a.error});else if(e===Hj){const f=a.i;ek(this,a,b).then(g=>{let h;null==(h=this.J.get(f))||h.next(g)})}else e===d&&Xj(this,Lj,{id:a.i,finalize:olympe.dc.transaction.sf.C.Ll,error:0<a.s?a.error:null})}ka(a,b){if(b instanceof olympe.dc.query.ta.wh){const c=b.relation;let d;b=Array.from(null!=(d=a.get(b.V()))?d:[]);return{t:c.X(),d:c.Ja()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ka.bind(this,
767
- a))}}return{}}};olympe.dc.sources.Vq.ya=[olympe.dc.sources.uj];function fk(a,b,c){const d=new olympe.D.Zb(`Source solver ${b.X()}`);b.fb(olympe.dm.rd.G.cc()).fb(olympe.dm.rd.F).ge().back().fb(olympe.dm.rd.C).ge().observe(d,{Od:c,yc:!0}).subscribe(e=>{jf(e).forEach(([f,g])=>{a.F.set(f.X(),g.V())});hf(e).forEach(([f])=>{a.F.delete(f)})});b.fb(olympe.dm.jb.F).observe(d,{Od:c,yc:!0}).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.Gc())?void 0:f.V())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
768
- olympe.dc.sources.dk=class{constructor(a,b,c){this.db=a;this.C=b;this.O=c;this.F=new Map;this.G=null;this.J=!1}fromModel(a){a=olympe.dc.ga(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.O}Ee(a){let b;return null!=(b=this.db.source(a))?b:this.O}sb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Qa.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.Rb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.J){this.J=
769
- !0;var a=new olympe.dc.Wa;Z(a.create(olympe.dm.DataSource,this.C).Uh(this.C),olympe.dm.DataSource.Gh,!0);a.Ha(olympe.dm.DataSource.dj,this.C,this.C);a.ob(()=>{olympe.dc.pa.from(this.C).observe(olympe.D.Og()).subscribe(()=>{})})}}};olympe.dc.sources.R={Ca:'dc.sources.Logger',xl:'dc.sources.HTTPService',Bt:'dc.sources.IOService',yq:'dc.sources.RemoteProvider',Oq:'dc.sources.ServerProvider',OA:'dc.sources.OfflineProvider',Se:'dc.sources.SourceSolver',ee:'dc.sources.Serializer',mo:'dc.sources.cache.Cache',no:'dc.sources.cache.DATABASE',Zk:'dc.sources.cache.Logger'};
770
- olympe.dc.sources.U={vl:'data.httpHost',ii:'data.httpPort',hp:'data.httpSSL',ul:'data.httpBasePath',Vl:'data.pollingFrequency',Ke:'data.communicationMode',cm:'data.restrictedUse',VERSION:'version.version'};
771
- olympe.W.config(function(a){var b=a.getParameter(olympe.N.U.jl);F(a,olympe.dc.sources.U.vl,b);var c=a.getParameter(olympe.dc.sources.U.vl);c=(b=['localhost','127.0.0.1'].includes(c))||c.endsWith(a.getParameter(olympe.net.U.Dj));F(a,olympe.dc.sources.U.ii,b?3141:c?80:443);F(a,olympe.dc.sources.U.hp,!c);F(a,olympe.dc.sources.U.ul,'runtime/data');F(a,olympe.dc.sources.U.Vl,null);F(a,olympe.dc.sources.U.Ke,null);F(a,olympe.dc.sources.U.cm,null);E(a,olympe.dc.sources.R.Ca,[olympe.ma.R.Ea],d=>d.Wc('data'));
772
- D(a,olympe.dc.sources.R.ee,olympe.dc.sources.fc,olympe.dc.db.R.Ea);La(a,olympe.N.R.ee,olympe.dc.sources.R.ee);D(a,olympe.dc.sources.R.xl,olympe.dc.sources.pt,olympe.dc.sources.R.Ca,olympe.net.R.Ki,olympe.N.R.wl,olympe.auth.R.Ea,olympe.dc.sources.R.Se,olympe.N.R.ee,new olympe.W.ja(olympe.N.U.Uk));D(a,olympe.dc.sources.R.Bt,olympe.dc.sources.pp,olympe.dc.sources.R.Ca,olympe.dc.R.Ag,olympe.net.R.Ea,olympe.auth.R.Ea);D(a,olympe.dc.sources.R.yq,olympe.dc.sources.Hq,olympe.dc.sources.R.Ca,new olympe.W.ja(olympe.dc.U.Dg),
773
- olympe.dc.sources.R.xl,olympe.N.R.ff,olympe.dc.R.gh,olympe.dc.sources.R.Se);D(a,olympe.dc.sources.R.Oq,olympe.dc.sources.Vq,olympe.dc.sources.R.Ca,olympe.N.R.Wj,olympe.N.R.ff,olympe.dc.sources.R.xl,new olympe.W.ja(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.Se,olympe.dc.sources.dk,olympe.dc.R.gh,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.U.ll));E(a,olympe.dc.sources.R.Zk,[olympe.ma.R.Ea],d=>d.Wc('datacache'));D(a,olympe.dc.sources.R.mo,olympe.dc.sources.cache.Cache,olympe.dc.sources.R.Zk,
774
- olympe.dc.R.Ag,olympe.dc.sources.R.no,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.N.R.ff,olympe.Db.R.Il,olympe.Y.R.jg,new olympe.W.ja(olympe.net.U.Xp),new olympe.W.ja(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.no,olympe.dc.sources.cache.Lj,olympe.Db.R.Fg,olympe.dc.sources.R.Zk,olympe.dc.sources.R.ee,olympe.Db.R.Cj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.R.Se,olympe.dc.sources.R.mo],(a,b)=>{olympe.dc.Xd=()=>a;olympe.dc.sources.Vd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.km=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.Rs=class extends olympe.dc.sources.cache.errors.km{};olympe.dc.sources.cache.errors.xv=class extends olympe.dc.sources.cache.errors.km{};olympe.dc.sources.cache.errors.Gv=class extends olympe.dc.sources.cache.errors.km{};function dj(a,b,c){return v(function*(){gk(a,'queries',b);yield a.init();const d=a.F.has(c)?a.F.get(c):new Set;d.has(b)||(d.add(b),a.F.set(c,d),a.O.next(hk(a)));return ik(a.C,b,c)})}
775
- function ej(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.V()}`);d.Z(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.aa)a.H.debug('Cache: persist graph patch',d.V()),e&&b&&(Array.from(d.bd()).filter(h=>!h.yd()).map(h=>h.tag()),yield jk(a.C)),yield kk(a.C,d,0<f.length?b:null),lk(a,d,c).catch(h=>{a.H.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.H.error(`Cache: Failed to handle graph patch ${d.V()} with message: ${f}`),
776
- a.hc.next(f)}finally{b&&mk(a,'queries',b)}}))().then(()=>{})})}function nk(){var a=olympe.dc.sources.Vd();a.aa=!0;a.vb=!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)}
777
- 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 v(function*(){a.G=new olympe.dc.db.xc;const b=yield pk(a.C);for(const c of b)c.Uc(a.G);a.ea.next(0<b.length)})}
778
- function lk(a,b,c){return v(function*(){const d=qk(b),e=[];for(const g of d){const h=g.tag();if(!(yield rk(a.C,h)))if(gk(a,'files',h),!1===g.Ra(olympe.dm.File.C.X())&&g.Ra(olympe.dm.File.urlProp.X())){var f=g.Ra(olympe.dm.File.urlProp.X());const k=N(f);k.F=olympe.net.Ba.ResponseType.Tk;e.push(new Promise((l,n)=>{a.Bc.C(k,p=>{p=p.Hc();200<=p&&300>p?l():n(`Failed to download file ${g}. Response code ${p}`);mk(a,'files',h)})}))}else{let k;const l=null!=(k=g.Ra(olympe.dm.File.mimeTypeProp.X()))?k:'application/octet-stream';
779
- f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Of,c,f);f=gb(a.Tc,()=>a.Yb.request(n).then(p=>sk(a.C,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.H.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
780
- function qk(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.pa.from(olympe.dm.File).ag(olympe.dc.CloudObject.extendedByRel).nd().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Lc(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.Lc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Lc(g));return c.concat(d)},[])}
781
- function tk(a,b){return Array.from(a.F.values()).some(c=>c.has(b))}function hk(a){return Array.from(a.F.keys()).filter(b=>'__code-as-data__'!==b)}function uk(a,b){return v(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.F.get(b))?c:[]);a.F.delete(b);var e=Array.from(a.F.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield vk(a.C,b);a.O.next(hk(a));d.filter(f=>!e.has(f));yield jk(a.C)}else yield Promise.all(hk(a).map(f=>uk(a,f)))})}
782
- 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].Z(a[b])}
783
- function xk(a,b,c){return v(function*(){var d=olympe.dc.Request.C.Ve;const e=olympe.dc.Request.C.og,f=olympe.dc.Request.C.Xf;a.H.debug('Sync Cache: Applying transaction patch to destination',c,b.V());const g=qk(b);a.H.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>v(function*(){const k=h.tag();var l=h.Wb();if(h.yd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield yk(a.C,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.C})}if(!dd(a.kb))throw Error('Lost connection, stop syncing');
784
- l=yield a.Yb.request(l);b.Qc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Hi(b,!1));if(!dd(a.kb))throw Error('Lost connection, stop syncing');yield a.Yb.request(d)})}
785
- function zk(a,b,c){return c instanceof olympe.N.errors.fk||c instanceof olympe.N.errors.eo?(a.H.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.Rs('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.N.errors.Gq?(a.H.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.xv('The transaction has been rejected by the datasource',
786
- c.message)):new olympe.dc.sources.cache.errors.Gv('Synchronisation error',c.message)}
787
- function Ak(){var a=olympe.dc.sources.Vd();if(a.T)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.T=!0;a.H.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>v(function*(){yield a.init();const c=yield Bk(a.C);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.H.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.V()})`);try{yield xk(a,
788
- h,f),yield Ck(a.C,h)}catch(k){throw zk(a,f,k);}d+=1;b.next([e,d])}}a.J=null}))().then(()=>{a.T=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{ok(a).finally(()=>{a.T=!1})});return b.asObservable()}
789
- function Dk(){const a=olympe.dc.sources.Vd();return v(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=qk(a.G);for(const e of d)b.has(e.tag())||(d=yield yk(a.C,e.tag()),c.files.push({t:e.tag(),m:d.C,c:a.ua.C(d.content)}),b.add(e.tag()));b=yield Ek(a.C);c.patches.push(...b);return JSON.stringify(c)})}
790
- function Fk(a){const b=olympe.dc.sources.Vd();return v(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.F(e.c),yield sk(b.C,e.t,d,e.m);yield Gk(b.C,c.patches);yield ok(b);b.Fa.wc($e(b.G))})}
791
- function Hk(){const a=olympe.dc.sources.Vd();return v(function*(){yield Ik(a.C);yield ok(a)})}
792
- olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Yb=b;this.C=c;this.Fa=d;this.Bc=e;this.kb=f;this.ab=g;this.ua=h;this.version=l;this.aa=this.version!==this.ab.get('__code-as-data-version__');this.Ib=this.vb=!1;this.F=new Map;this.O=new rxjs.BehaviorSubject([]);this.J=null;this.ea=new rxjs.BehaviorSubject(!1);this.G=new olympe.dc.db.xc;this.Ub=this.bc=!1;this.ka=[];this.Z=0;this.ad=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});
793
- this.T=!1;this.hc=new rxjs.Subject;this.Tc=new olympe.Y.promise.mv(k)}Hc(){return this.status.asObservable()}init(){const a=this;return v(function*(){if(!a.bc)if(a.Ub)yield new Promise(b=>{a.ka.push(b)});else{a.Ub=!0;(yield Jk(a.C)).forEach(b=>{a.F.set(b.name,new Set(b.C))});a.O.next(hk(a));yield ok(a);a.Fa.wc($e(a.G));for(const b of a.ka)b();a.bc=!0;a.ka=[]}})}executeQuery(a){const b=this;return v(function*(){yield b.init();return tk(b,a.V())&&uh(a).some(c=>c instanceof olympe.dc.query.ta.Rd)?Kk(b.C,
794
- a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.uc(),e=Array.from(d.C.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.J)?void 0:f.C.C.keys())?g:[]);let k;b!==(null==(k=c.J)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield Lk(c.C,d,b),c.J=new olympe.dc.sources.cache.Ps(d,b),c.ea.next(!0)):(d.Uc(c.J.C),yield Lk(c.C,c.J.C,b));d.Uc(c.G);yield kk(c.C,d,'local-transaction')})}uploadFileContent(a,b,c){const d=
795
- this;return v(function*(){yield d.init();yield sk(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return yk(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield Mk(b.C,[a])})}};olympe.dc.sources.cache.Ps=class{constructor(a,b){this.C=a;this.F=b}};olympe.dc.sources.cache.Cache.F='__code-as-data-version__';olympe.dc.sources.cache.Cache.C='__code-as-data__';function Jk(a){return v(function*(){return(yield a.db.G('buckets')).map(b=>olympe.dc.sources.cache.aq.Vb(b))})}function pk(a){return v(function*(){return(yield a.db.G('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.sh.Vb(b);return a.C.J(b.C)})})}function ik(a,b,c){return v(function*(){a.H.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.F()})}function jk(a){return v(function*(){return a.db.F()})}
796
- function kk(a,b,c){a.H.debug(`Offline DB: Apply patch ${b.V()} on local offline db`);Array.from(b.C.keys());return a.db.F().then(()=>{null===c&&(b.C.forEach((d,e)=>a.G.add(e)),a.J().then(()=>{}))})}function rk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.F.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
797
- function sk(a,b,c,d){c=new olympe.dc.sources.cache.Tl(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 v(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Bk(a){return v(function*(){return(yield a.db.G('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.sh.Vb(c);const d=c.F;let e;const f=null!=(e=b.get(d))?e:[];f.push(a.C.J(c.C));b.set(d,f);return b},new Map)})}
798
- function Ck(a,b){return v(function*(){return a.db.remove('pending-transactions',b.V()).then(()=>{})})}function yk(a,b){return v(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.Tl.Vb(c)})}function Ek(a){return v(function*(){return a.db.G('pending-transactions')})}
799
- function Gk(a,b){return v(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.sh.Vb(d);e&&c.set(e.C.i,d)}yield a.db.ea()})}function Ik(a){return v(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
800
- function Kk(a,b){return v(function*(){const c=b.sb();a.H.debug(`Offline DB: Executing query ${b.V()} by ID with source ${c}`);const d=olympe.dc.query.td.Ti(b);var e=(yield a.db.J(b.V())).map(f=>olympe.dc.sources.cache.wg.Vb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Lj.ec(f);const g=Nk(a,f.Dd);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.nc.Zc&&!0===e||d.Ha(k,e?n:f.tag,e?f.tag:n)}}a.H.C()&&
801
- a.H.debug(`Offline DB: Data result for query ${b.V()}`,d.uc().C.size,'instances',Array.from(d.uc().xd()).length,'relations');return d})}function Lk(a,b,c){b=a.C.ha(b);a.H.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.sh(c,b,Date.now())).toJSON())}function Ok(a){return v(function*(){return a.db.O('pending-transactions')})}function Mk(a,b){return v(function*(){b.forEach(c=>a.files.delete(c));yield a.db.aa()})}
802
- function Nk(a,b){return Object.entries(b).reduce((c,[d,e])=>c.set(d,a.C.J(e)),new Map)}
803
- olympe.dc.sources.cache.Lj=class{constructor(a,b,c,d){this.O=`Olympe_Cache_${a}`;this.H=b;this.C=c;this.db=d.F(this.O);this.G=new Set;this.F=[];this.files=null;this.db.T('files').then(e=>{this.files=new Set(e);this.F.forEach(f=>f(null))}).catch(e=>{this.F.forEach(f=>f(e))});this.J=olympe.Y.Promise.nk(()=>{const e=this;return v(function*(){if(!(0===e.G.size||0<(yield Ok(e))))if(0<e.db.Z())e.J().then(()=>{}),e.H.debug('Offline DB GC: Postponing round while the stack is busy');else{e.H.debug(`Offline DB GC: Round with ${e.G.size} candidates`);
804
- var f=Date.now();yield e.db.F().then(()=>{});e.H.debug(`Offline DB GC: has taken ${Date.now()-f}ms to run`)}})},5E3)}static ec(a){const b=new RegExp(`^(${olympe.dc.nc.Zc})>([a-z0-9]*)$`);for(const c of a.pb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return v(function*(){const c=Date.now();b.H.debug(`Offline DB: Executing query ${a.V()} with source ${a.sb()}`);const d=olympe.dc.query.td.Ti(a),e=a.sb();var f=yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.wg.Vb(f);
805
- if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Lj.ec(g),Nk(b,g.Dd));for(const p of uh(a))if(p instanceof olympe.dc.query.ta.wh){var k=p.relation;g=k.Ja()===olympe.dc.wa.ORIGIN;const q=k.X(),r=k.cc();k=new Set;f.set(p.V(),k);const t=[f.has(p.C)?new Set(f.get(p.C)):new Set([a.F])];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.H.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
806
- Promise.resolve([]);r.X();return b.db.J().then(z=>z.map(A=>olympe.dc.sources.cache.wg.Vb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ta.ue&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ta.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.Lj.ec(A),d.create(l,n,Nk(b,A.Dd)));q===olympe.dc.nc.Zc&&!0===g||d.Ha(q,g?l:y,g?y:l)}}}}else p instanceof
807
- olympe.dc.query.ta.Rd&&b.H.warn(`Offline DB: Trying to execute a query ${a.V()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.H.C()&&(b.H.debug(`Offline DB: Data result for query ${a.V()}`,d.uc().C.size,'instances',Array.from(d.uc().xd()).length,'relations'),b.H.debug(`Offline DB: Data result for query ${a.V()} took ${Date.now()-c}ms to be executed`));return d})}};
808
- olympe.dc.sources.cache.aq=class{constructor(a,b){this.name=a;this.C=b}static Vb(a){return a?new olympe.dc.sources.cache.aq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.C}}};
809
- olympe.dc.sources.cache.wg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Dd=null!=c?c:{};this.pb=null!=d?d:[];this.C=null!=e?e:[]}static Vb(a){return a?new olympe.dc.sources.cache.wg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Dd,relations:this.pb,queryIds:this.C}}};
810
- olympe.dc.sources.cache.sh=class{constructor(a,b,c){this.F=a;this.C=b;this.timestamp=c}static Vb(a){return a?new olympe.dc.sources.cache.sh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp}}};
811
- olympe.dc.sources.cache.Cu=class extends olympe.dc.sources.cache.sh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Vb(a){return a?new olympe.dc.sources.cache.Cu(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp,error:this.error}}};
812
- olympe.dc.sources.cache.Tl=class{constructor(a,b,c){this.tag=a;this.content=b;this.C=c}static Vb(a){return a?new olympe.dc.sources.cache.Tl(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.C}}};function Pk(a,b){let c=a.O.get(b);c||(c=new Set(a.C.get(b).pb),a.O.set(b,c));return c}
813
- olympe.dc.sources.cache.st=class{constructor(a,b,c){this.H=a;this.G=c;this.C=new Map;this.T=new Set;this.Z=new Set;this.J=b;this.O=new Map}bd(){this.T.forEach(a=>this.C.delete(a));Array.from(this.C.entries()).forEach(([a,b])=>{b||this.C.delete(a)});return this.C}Vc(a,b,c){const d=this.C.get(a);d||this.Z.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.J.ha(k[1]);return h},null!=(e=null==d?void 0:d.Dd)?e:{});let f;e=null!=(f=null==d?void 0:d.C)?f:[];null===this.G||e.includes(this.G)||
814
- e.push(this.G);let g;b=new olympe.dc.sources.cache.wg(a,b,c,null!=(g=null==d?void 0:d.pb)?g:[],e);this.C.set(a,b)}Qc(a,b){const c=this.C.get(a);if(c){var d;c.Dd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.J.ha(g);return e},null!=(d=c.Dd)?d:{})}else this.H.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}F(a){this.T.add(a)}Ha(a,b,c){var d;const e=null!=(d=this.C.get(b))?d:new olympe.dc.sources.cache.wg(b,'unknown',{},[],[]);var f;
815
- d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.wg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.wa.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=Pk(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.G||g.C.includes(this.G)||g.C.push(this.G)};f(e,`${a}${olympe.dc.wa.DESTINATION}${c}`);f(d,b)}jc(a,b,c){const d=this.C.get(b),e=this.C.get(c);c=`${a}${olympe.dc.wa.DESTINATION}${c}`;a=`${a}${olympe.dc.wa.ORIGIN}${b}`;b=(f,g)=>{const h=Pk(this,f.tag);if(h.has(g)){const k=f.pb.indexOf(g);
816
- f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.st.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.ai=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Mc();this.F=new olympe.D.Zb('BurstTransaction#'+this.id,c);this.vb=Qk(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.J=new Set;this.C=null;let d;this.ab=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Gn))?d:30;this.ka=[]}static C(b,c){return`${b},${c}`}Ib(b){for(const c of this.ka)c(b);this.stop()}Fa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ea(this.J);0<b.size&&Rk(this,
817
- b,!1);this.J.clear()}ea(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.G.get(d))});return c}aa(b,c,d){this.ua(b,c,d);this.vb(b,c,d);null===this.C&&(this.C=setTimeout(this.Fa.bind(this),this.ab))}ua(b,c,d){b=a.C(b,c);this.G.set(b,d);this.J.add(b)}kb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ga(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ga(f),this.kb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
818
- c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.ma.gb('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.en([d],g=>{this.T=!0;if(g instanceof olympe.dc.Fc)olympe.ma.gb('dc').error('Cannot send complex property values in burst transactions');else{var h;this.aa(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();
819
- this.ka.length=0}getContext(){return this.F}V(){return this.id}Xg(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.J.clear();const c=this.ea(new Set(this.G.keys()));Rk(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.ai.prototype.complete=olympe.dc.ai.prototype.complete;olympe.dc.ai.prototype.push=olympe.dc.ai.prototype.push;olympe.dc.cq=class{C(){}toString(){}};olympe.dc.transaction.zi=class a{constructor(b){this.F=null!=b?b:olympe.dc.Qa.SERVER}C(b,c){c=new olympe.dc.db.xc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Vc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.Qc(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ha(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.jc(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
759
+ function Tj(a,b,c,d){const e=Hi(a.C,a.V(),b);if('string'!==typeof e)return Promise.reject(`ServerProvider: no url for type ${b}`);b=N(`${e}${'string'===typeof d&&0<d.length?`?${d}`:''}`,void 0!==c?olympe.net.Ba.Sd.uh:olympe.net.Ba.Sd.GET,c&&JSON.stringify(c));oc(b,{[olympe.net.Ba.Headers.ci]:'application/json'});return Ii(a.C,b).then(f=>'string'===typeof f&&0<f.length?JSON.parse(f):f)}
760
+ function ck(a,b){if(!b||'object'!==typeof b)throw Error('Data result can be created only from Object');if(0<b.s)throw Error(b.error);return mf(b.p,a.V())}function ek(a,b,c){return v(function*(){const d=b.pi;let e;if(c instanceof olympe.Y.stream.Bg){e=new olympe.dc.db.uc(d);try{for(const f=ha(c);;){const g=yield f.next();if(g.done)break;a.aa.C(g.value.p,d).Kc(e)}}catch(f){a.H.error(`Error while reading the stream: ${f}`),e=new olympe.dc.db.uc(d)}}else e=a.aa.C(b.p,d);return $e(e,b.ct)})}
761
+ olympe.dc.sources.Wq=class extends olympe.dc.sources.cl{constructor(a,b,c,d,e){super(a,c);this.G=b;this.C=d;this.aa=new olympe.dc.transaction.th(this.V());this.K=new Map;this.O=new Set;this.version=e||'unknown';olympe.D.Zi(this.F.cg(),()=>{this.K.forEach((f,g)=>{f.error(new olympe.N.errors.Hj('Connection to server has been recovered',g))})})}V(){return olympe.dc.Qa.SERVER}T(a){var b=a.getType(),c=a.content,d=ff(a);switch(b){case Rj:return c=olympe.dm.DataSource.Lb.zb,a=olympe.dm.DataSource.Lb.wh,
762
+ Promise.resolve(Fd(this.G)?{s:a}:{s:c,r:'Disconnected'});case wj:return Sj(this);case xj:return Uj(this,c);case yj:return Wj(this,c);case zj:return Yj(this,c);case Pj:return Zj(this,c);case Cj:return d.get(olympe.dc.pa.C.rp)?ak(this,c):dk(this,c);case Aj:return Fd(this.G)?(c=bk(this,olympe.dc.pa.from(c)),c.f=olympe.dc.Ob.vo,c=N(Hi(this.C,olympe.dc.Qa.SERVER,Aj),olympe.net.Ba.Sd.uh,JSON.stringify(c),olympe.net.Ba.ResponseType.Ji),oc(c,{[olympe.net.Ba.Headers.ci]:olympe.net.Ba.fl.JSON}),c=Ii(this.C,
763
+ c)):(this.H.error(`Server is disconnected, backup of instance ${c} is canceled.`),c=Promise.reject('Server is disconnected')),c;case Bj:return a=c.$D,b=c.debug,c=c.optional,Fd(this.G)?(d=Hi(this.C,olympe.dc.Qa.SERVER,Bj),c=N(d+`?debug=${b}&optional=${c}`,olympe.net.Ba.Sd.uh,a),oc(c,{[olympe.net.Ba.Headers.ci]:olympe.net.Ba.fl.Kv}),c=Ii(this.C,c)):(this.H.error('Server is disconnected, restore of instance is canceled.'),c=Promise.reject('Server is disconnected')),c;case Mj:case Nj:case Oj:case Qj:return Vj(this,
764
+ b,{});case Jj:return this.C.downloadFileContent(a);case Ij:return this.C.deleteFileContent(a);case Kj:return this.C.uploadFileContent(a);default:return Promise.reject(`ServerProvider: Message of type ${b} not supported yet`)}}Z(a,b){if(a.getType()===Dj){const c=a.content,d=c.V();return(new rxjs.Observable(e=>{const f=bk(this,c);this.O.delete(d);this.K.set(d,e);Vj(this,Fj,f).catch(g=>e.error(g))})).pipe(db(olympe.N.errors.Hj,(e,f)=>{this.H.debug(`Subscribe to topic ${e.V()} now that we are back online, after waiting for ${f}ms`);
765
+ b()}),rxjs.operators.finalize(()=>{this.O.add(d);Vj(this,Gj,{i:d}).catch(e=>{this.H.warn(`Fail to unsubscribe to graphdef ${d}: ${e}`)}).finally(()=>{this.O.has(d)&&this.K.delete(d);this.O.delete(d)})}))}return rxjs.throwError(()=>Error(`Subscription of type ${a.getType()} is not supported`))}init(a){super.init(a);Dd(this.G,olympe.N.Pe.ng,this.ua.bind(this));return this}destroy(){return v(function*(){})}ua(a,b){const c=olympe.dc.Request.C.Hn,d=olympe.dc.Request.C.Ll,e=a.c;if(e===olympe.dc.Request.C.lo)ek(this,
766
+ a,b).then(f=>{Xj(this,e,f)});else if(e===c)b=this.aa.C(a.p,a.i),Xj(this,e,{rollback:$e(b,a.ct),error:a.error});else if(e===Hj){const f=a.i;ek(this,a,b).then(g=>{let h;null==(h=this.K.get(f))||h.next(g)})}else e===d&&Xj(this,Lj,{id:a.i,finalize:olympe.dc.transaction.tf.C.Ll,error:0<a.s?a.error:null})}ka(a,b){if(b instanceof olympe.dc.query.ta.xh){const c=b.relation;let d;b=Array.from(null!=(d=a.get(b.V()))?d:[]);return{t:c.X(),d:c.Ja()===olympe.dc.wa.ORIGIN?1:2,v:!0,r:c.recursive,q:b.map(this.ka.bind(this,
767
+ a))}}return{}}};olympe.dc.sources.Wq.ya=[olympe.dc.sources.uj];function fk(a,b,c){const d=new olympe.D.Zb(`Source solver ${b.X()}`);b.gb(olympe.dm.rd.G.cc()).gb(olympe.dm.rd.F).fe().back().gb(olympe.dm.rd.C).fe().observe(d,{Od:c,zc:!0}).subscribe(e=>{jf(e).forEach(([f,g])=>{a.F.set(f.X(),g.V())});hf(e).forEach(([f])=>{a.F.delete(f)})});b.gb(olympe.dm.jb.F).observe(d,{Od:c,zc:!0}).subscribe(e=>{let f,g;a.G=null!=(g=null==(f=e.Gc())?void 0:f.V())?g:null});d.onDestroy(()=>{a.F.clear();a.G=null})}
768
+ olympe.dc.sources.dk=class{constructor(a,b,c){this.db=a;this.C=b;this.O=c;this.F=new Map;this.G=null;this.K=!1}fromModel(a){a=olympe.dc.ga(a);return this.F.has(a)?this.F.get(a):this.G&&this.T(a)?this.G:this.O}Ee(a){let b;return null!=(b=this.db.source(a))?b:this.O}sb(a){return a===this.C?olympe.dc.CloudObject.get(this.C):a===olympe.dc.Qa.SERVER?olympe.dc.CloudObject.get(olympe.dm.DataSource.SERVER):this.db.Ia(a)&&this.db.Sb(a,olympe.dm.DataSource)?olympe.dc.CloudObject.get(a):null}T(){return!1}init(){if(!this.K){this.K=
769
+ !0;var a=new olympe.dc.Wa;Z(a.create(olympe.dm.DataSource,this.C).Vh(this.C),olympe.dm.DataSource.Hh,!0);a.Ha(olympe.dm.DataSource.dj,this.C,this.C);a.ob(()=>{olympe.dc.pa.from(this.C).observe(olympe.D.Og()).subscribe(()=>{})})}}};olympe.dc.sources.R={Ca:'dc.sources.Logger',xl:'dc.sources.HTTPService',Ct:'dc.sources.IOService',zq:'dc.sources.RemoteProvider',Pq:'dc.sources.ServerProvider',PA:'dc.sources.OfflineProvider',Se:'dc.sources.SourceSolver',ze:'dc.sources.Serializer',mo:'dc.sources.cache.Cache',no:'dc.sources.cache.DATABASE',Zk:'dc.sources.cache.Logger'};
770
+ olympe.dc.sources.U={vl:'data.httpHost',ji:'data.httpPort',hp:'data.httpSSL',ul:'data.httpBasePath',Vl:'data.pollingFrequency',Ke:'data.communicationMode',cm:'data.restrictedUse',VERSION:'version.version'};
771
+ olympe.W.config(function(a){var b=a.getParameter(olympe.N.U.jl);F(a,olympe.dc.sources.U.vl,b);var c=a.getParameter(olympe.dc.sources.U.vl);c=(b=['localhost','127.0.0.1'].includes(c))||c.endsWith(a.getParameter(olympe.net.U.Dj));F(a,olympe.dc.sources.U.ji,b?3141:c?80:443);F(a,olympe.dc.sources.U.hp,!c);F(a,olympe.dc.sources.U.ul,'runtime/data');F(a,olympe.dc.sources.U.Vl,null);F(a,olympe.dc.sources.U.Ke,null);F(a,olympe.dc.sources.U.cm,null);E(a,olympe.dc.sources.R.Ca,[olympe.ma.R.Ea],d=>d.Wc('data'));
772
+ D(a,olympe.dc.sources.R.ze,olympe.dc.sources.fc,olympe.dc.db.R.Ea);La(a,olympe.N.R.ze,olympe.dc.sources.R.ze);D(a,olympe.dc.sources.R.xl,olympe.dc.sources.qt,olympe.dc.sources.R.Ca,olympe.net.R.Ki,olympe.N.R.wl,olympe.auth.R.Ea,olympe.dc.sources.R.Se,olympe.N.R.ze,new olympe.W.ja(olympe.N.U.Uk));D(a,olympe.dc.sources.R.Ct,olympe.dc.sources.qp,olympe.dc.sources.R.Ca,olympe.dc.R.Ag,olympe.net.R.Ea,olympe.auth.R.Ea);D(a,olympe.dc.sources.R.zq,olympe.dc.sources.Iq,olympe.dc.sources.R.Ca,new olympe.W.ja(olympe.dc.U.Dg),
773
+ olympe.dc.sources.R.xl,olympe.N.R.ff,olympe.dc.R.gh,olympe.dc.sources.R.Se);D(a,olympe.dc.sources.R.Pq,olympe.dc.sources.Wq,olympe.dc.sources.R.Ca,olympe.N.R.Wj,olympe.N.R.ff,olympe.dc.sources.R.xl,new olympe.W.ja(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.Se,olympe.dc.sources.dk,olympe.dc.R.gh,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.U.ll));E(a,olympe.dc.sources.R.Zk,[olympe.ma.R.Ea],d=>d.Wc('datacache'));D(a,olympe.dc.sources.R.mo,olympe.dc.sources.cache.Cache,olympe.dc.sources.R.Zk,
774
+ olympe.dc.R.Ag,olympe.dc.sources.R.no,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.N.R.ff,olympe.Db.R.Il,olympe.Y.R.jg,new olympe.W.ja(olympe.net.U.Yp),new olympe.W.ja(olympe.dc.sources.U.VERSION));D(a,olympe.dc.sources.R.no,olympe.dc.sources.cache.Lj,olympe.Db.R.Fg,olympe.dc.sources.R.Zk,olympe.Db.R.Cj)},'olympe.dc.sources');olympe.W.run([olympe.dc.sources.R.Se,olympe.dc.sources.R.mo],(a,b)=>{olympe.dc.Xd=()=>a;olympe.dc.sources.Vd=()=>b});olympe.dc.sources.cache={};olympe.dc.sources.cache.errors={};olympe.dc.sources.cache.errors.km=class extends Error{constructor(a){super(a)}};olympe.dc.sources.cache.errors.Ss=class extends olympe.dc.sources.cache.errors.km{};olympe.dc.sources.cache.errors.yv=class extends olympe.dc.sources.cache.errors.km{};olympe.dc.sources.cache.errors.Hv=class extends olympe.dc.sources.cache.errors.km{};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.D.Color.Qb(a);case 17:return new olympe.dc.vc(a.v);case 13:return(new olympe.dc.transaction.th).C(a.v,a.i);default:throw Error(`Impossible to deserialize the following value: ${a}`);}}
775
+ olympe.dc.sources.cache.ip=class{ha(a){switch(!0){case null===a:case void 0===a:return null;case 'string'===typeof a:case 'boolean'===typeof a:case 'number'===typeof a:return a;case a instanceof olympe.D.fb:return{t:1,d:a.valueOf().toISOString()};case a instanceof Date:return{t:1,d:a.toISOString()};case a instanceof olympe.D.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.uc:const b=new olympe.dc.transaction.pf;a.Kc(b);
776
+ return{t:13,i:a.V(),v:nf(b)};default:throw Error(`Impossible to serialize the following value: ${a}`);}}};function dj(a,b,c){return v(function*(){hk(a,'queries',b);yield a.init();const d=a.F.has(c)?a.F.get(c):new Set;d.has(b)||(d.add(b),a.F.set(c,d),a.O.next(ik(a)));return jk(a.C,b,c)})}
777
+ function ej(a,b,c,d,e=!1){return v(function*(){yield a.init();a.H.debug(`Cache: handle query ${b} graph patch: ${d.V()}`);d.Z(a.G);(()=>v(function*(){try{const f=null===b?[]:Array.from(a.F.entries()).filter(([,h])=>h.has(b)).map(([h])=>h),g=1===f.length&&'__code-as-data__'===f[0];if(null===b||!g||a.aa)a.H.debug('Cache: persist graph patch',d.V()),e&&b&&(Array.from(d.bd()).filter(h=>!h.yd()).map(h=>h.tag()),yield kk(a.C)),yield lk(a.C,d,0<f.length?b:null),mk(a,d,c).catch(h=>{a.H.error(`Cache: Failed to download files of a graph patch: ${h}`)})}catch(f){a.H.error(`Cache: Failed to handle graph patch ${d.V()} with message: ${f}`),
778
+ a.hc.next(f)}finally{b&&nk(a,'queries',b)}}))().then(()=>{})})}function ok(){var a=olympe.dc.sources.Vd();a.aa=!0;a.vb=!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)}
779
+ 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 v(function*(){a.G=new olympe.dc.db.uc;const b=yield qk(a.C);for(const c of b)c.Kc(a.G);a.ea.next(0<b.length)})}
780
+ function mk(a,b,c){return v(function*(){const d=rk(b),e=[];for(const g of d){const h=g.tag();if(!(yield sk(a.C,h)))if(hk(a,'files',h),!1===g.Ra(olympe.dm.File.C.X())&&g.Ra(olympe.dm.File.urlProp.X())){var f=g.Ra(olympe.dm.File.urlProp.X());const k=N(f);k.F=olympe.net.Ba.ResponseType.Tk;e.push(new Promise((l,n)=>{a.Cc.C(k,p=>{p=p.Hc();200<=p&&300>p?l():n(`Failed to download file ${g}. Response code ${p}`);nk(a,'files',h)})}))}else{let k;const l=null!=(k=g.Ra(olympe.dm.File.mimeTypeProp.X()))?k:'application/octet-stream';
781
+ f={tag:h,model:g.Wb(),mimeType:l};const n=new olympe.dc.Request(olympe.dc.Request.C.Pf,c,f);f=gb(a.Uc,()=>a.Yb.request(n).then(p=>tk(a.C,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.H.warn(`Cache: File content for ${null==(l=d[k])?void 0:l.tag()} was not found`)}})})})}
782
+ function rk(a){const b=[olympe.dc.ga(olympe.dm.File)];if(olympe.dc.CloudObject.exists(olympe.dm.File))b.push(...olympe.dc.pa.from(olympe.dm.File).ag(olympe.dc.CloudObject.extendedByRel).nd().keys());else for(const c of b){let d,e;b.push(...(null!=(e=null==(d=a.Mc(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.Mc(d))?void 0:e.bb(olympe.dc.CloudObject.instancesRel,g=>g))?f:[]).map(g=>a.Mc(g));return c.concat(d)},[])}
783
+ function uk(a,b){return Array.from(a.F.values()).some(c=>c.has(b))}function ik(a){return Array.from(a.F.keys()).filter(b=>'__code-as-data__'!==b)}function vk(a,b){return v(function*(){yield a.init();if(b){var c,d=Array.from(null!=(c=a.F.get(b))?c:[]);a.F.delete(b);var e=Array.from(a.F.values()).reduce((f,g)=>{g.forEach(h=>f.add(h));return f},new Set);yield wk(a.C,b);a.O.next(ik(a));d.filter(f=>!e.has(f));yield kk(a.C)}else yield Promise.all(ik(a).map(f=>vk(a,f)))})}
784
+ 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].Z(a[b])}
785
+ function yk(a,b,c){return v(function*(){var d=olympe.dc.Request.C.Ve;const e=olympe.dc.Request.C.og,f=olympe.dc.Request.C.Xf;a.H.debug('Sync Cache: Applying transaction patch to destination',c,b.V());const g=rk(b);a.H.debug(`Sync Cache: Found ${g.length} files to send`);yield Promise.all(g.map(h=>v(function*(){const k=h.tag();var l=h.Wb();if(h.yd())l=new olympe.dc.Request(e,c,{tag:k,model:l});else{const n=yield zk(a.C,k);l=new olympe.dc.Request(f,c,{tag:k,model:l,content:n.content,mimeType:n.C})}if(!dd(a.kb))throw Error('Lost connection, stop syncing');
786
+ l=yield a.Yb.request(l);b.Rc(k,new Map([[olympe.dm.File.urlProp.X(),l]]))})));d=new olympe.dc.Request(d,c,new olympe.dc.transaction.Hi(b,!1));if(!dd(a.kb))throw Error('Lost connection, stop syncing');yield a.Yb.request(d)})}
787
+ function Ak(a,b,c){return c instanceof olympe.N.errors.fk||c instanceof olympe.N.errors.eo?(a.H.error('Sync Cache: Timeout or Connection error',c),new olympe.dc.sources.cache.errors.Ss('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.N.errors.Hq?(a.H.error(`Sync Cache: transaction has been rejected by ${b} data source`,c),new olympe.dc.sources.cache.errors.yv('The transaction has been rejected by the datasource',
788
+ c.message)):new olympe.dc.sources.cache.errors.Hv('Synchronisation error',c.message)}
789
+ function Bk(){var a=olympe.dc.sources.Vd();if(a.T)return rxjs.throwError(()=>Error('Another synchronisation is in progress'));a.T=!0;a.H.info('Sync Cache: Start synchronising transactions');const b=new rxjs.BehaviorSubject([null,null]);(()=>v(function*(){yield a.init();const c=yield Ck(a.C);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.H.debug(`Sync Cache: Processing patch ${d+1}/${e} (${h.V()})`);try{yield yk(a,
790
+ h,f),yield Dk(a.C,h)}catch(k){throw Ak(a,f,k);}d+=1;b.next([e,d])}}a.K=null}))().then(()=>{a.T=!1;b.complete()}).catch(c=>{b.error(c.message)}).finally(()=>{pk(a).finally(()=>{a.T=!1})});return b.asObservable()}
791
+ function Ek(){const a=olympe.dc.sources.Vd();return v(function*(){var b=new Set;const c={files:[],patches:[],version:a.version};var d=rk(a.G);for(const e of d)b.has(e.tag())||(d=yield zk(a.C,e.tag()),c.files.push({t:e.tag(),m:d.C,c:a.ua.C(d.content)}),b.add(e.tag()));b=yield Fk(a.C);c.patches.push(...b);return JSON.stringify(c)})}
792
+ function Gk(a){const b=olympe.dc.sources.Vd();return v(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.F(e.c),yield tk(b.C,e.t,d,e.m);yield Hk(b.C,c.patches);yield pk(b);b.Fa.yc($e(b.G))})}
793
+ function Ik(){const a=olympe.dc.sources.Vd();return v(function*(){yield Jk(a.C);yield pk(a)})}
794
+ olympe.dc.sources.cache.Cache=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.Yb=b;this.C=c;this.Fa=d;this.Cc=e;this.kb=f;this.ab=g;this.ua=h;this.version=l;this.aa=this.version!==this.ab.get('__code-as-data-version__');this.Ib=this.vb=!1;this.F=new Map;this.O=new rxjs.BehaviorSubject([]);this.K=null;this.ea=new rxjs.BehaviorSubject(!1);this.G=new olympe.dc.db.uc;this.Vb=this.bc=!1;this.ka=[];this.Z=0;this.ad=new rxjs.BehaviorSubject(!1);this.status=new rxjs.BehaviorSubject({processing:!1});
795
+ this.T=!1;this.hc=new rxjs.Subject;this.Uc=new olympe.Y.promise.nv(k)}Hc(){return this.status.asObservable()}init(){const a=this;return v(function*(){if(!a.bc)if(a.Vb)yield new Promise(b=>{a.ka.push(b)});else{a.Vb=!0;(yield Kk(a.C)).forEach(b=>{a.F.set(b.name,new Set(b.C))});a.O.next(ik(a));yield pk(a);a.Fa.yc($e(a.G));for(const b of a.ka)b();a.bc=!0;a.ka=[]}})}executeQuery(a){const b=this;return v(function*(){yield b.init();return uk(b,a.V())&&uh(a).some(c=>c instanceof olympe.dc.query.ta.Rd)?Lk(b.C,
796
+ a):b.C.executeQuery(a)})}applyTransaction(a,b){const c=this;return v(function*(){c.H.debug('Cache: apply transaction',a,b);yield c.init();const d=a.rc(),e=Array.from(d.C.keys());let f,g;const h=Array.from(null!=(g=null==(f=c.K)?void 0:f.C.C.keys())?g:[]);let k;b!==(null==(k=c.K)?void 0:k.F)||e.some(l=>!h.includes(l))?(yield Mk(c.C,d,b),c.K=new olympe.dc.sources.cache.Qs(d,b),c.ea.next(!0)):(d.Kc(c.K.C),yield Mk(c.C,c.K.C,b));d.Kc(c.G);yield lk(c.C,d,'local-transaction')})}uploadFileContent(a,b,c){const d=
797
+ this;return v(function*(){yield d.init();yield tk(d.C,a,b,c);return`offline://${a}`})}downloadFileContent(a){const b=this;return v(function*(){yield b.init();return zk(b.C,a).then(c=>c.content)})}deleteFileContent(a){const b=this;return v(function*(){yield b.init();yield Nk(b.C,[a])})}};olympe.dc.sources.cache.Qs=class{constructor(a,b){this.C=a;this.F=b}};olympe.dc.sources.cache.Cache.F='__code-as-data-version__';olympe.dc.sources.cache.Cache.C='__code-as-data__';function Kk(a){return v(function*(){return(yield a.db.G('buckets')).map(b=>olympe.dc.sources.cache.bq.Qb(b))})}function qk(a){return v(function*(){return(yield a.db.G('pending-transactions')).map(b=>{b=olympe.dc.sources.cache.sh.Qb(b);return gk(b.C)})})}function jk(a,b,c){return v(function*(){a.H.debug(`Offline DB: Adding query ${b} in bucket ${c}`);return a.db.F()})}function kk(a){return v(function*(){return a.db.F()})}
798
+ function lk(a,b,c){a.H.debug(`Offline DB: Apply patch ${b.V()} on local offline db`);Array.from(b.C.keys());return a.db.F().then(()=>{null===c&&(b.C.forEach((d,e)=>a.F.add(e)),a.G().then(()=>{}))})}function sk(a,b){return new Promise((c,d)=>{null!==a.files?c(a.files.has(b)):a.C.push(e=>{let f;return e?d(e):c(!(null==(f=a.files)||!f.has(b)))})})}
799
+ function tk(a,b,c,d){c=new olympe.dc.sources.cache.Tl(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 v(function*(){return a.db.remove('buckets',b).then(()=>{})})}function Ck(a){return v(function*(){return(yield a.db.G('pending-transactions')).reduce((b,c)=>{c=olympe.dc.sources.cache.sh.Qb(c);const d=c.F;let e;const f=null!=(e=b.get(d))?e:[];f.push(gk(c.C));b.set(d,f);return b},new Map)})}
800
+ function Dk(a,b){return v(function*(){return a.db.remove('pending-transactions',b.V()).then(()=>{})})}function zk(a,b){return v(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.Tl.Qb(c)})}function Fk(a){return v(function*(){return a.db.G('pending-transactions')})}
801
+ function Hk(a,b){return v(function*(){const c=new Map;for(const d of b){const e=olympe.dc.sources.cache.sh.Qb(d);e&&c.set(e.C.i,d)}yield a.db.ea()})}function Jk(a){return v(function*(){return a.db.clear('pending-transactions').then(()=>{})})}
802
+ function Lk(a,b){return v(function*(){const c=b.sb();a.H.debug(`Offline DB: Executing query ${b.V()} by ID with source ${c}`);const d=olympe.dc.query.td.Ti(b);var e=(yield a.db.K(b.V())).map(f=>olympe.dc.sources.cache.wg.Qb(f));for(const f of e){if(f.source!==c)continue;e=olympe.dc.sources.cache.Lj.ec(f);const g=Ok(f.Dd);d.create(f.tag,e,g);for(const h of f.pb)if(e=h.match(/^([a-z0-9]*)(<|>)([a-z0-9]*)$/)){const [,k,l,n]=e;e='<'===l;k===olympe.dc.nc.Zc&&!0===e||d.Ha(k,e?n:f.tag,e?f.tag:n)}}a.H.C()&&
803
+ a.H.debug(`Offline DB: Data result for query ${b.V()}`,d.rc().C.size,'instances',Array.from(d.rc().xd()).length,'relations');return d})}function Mk(a,b,c){b=a.O.ha(b);a.H.debug(`save transaction in destination '${c}'`,JSON.stringify(b));return a.db.set('pending-transactions',(new olympe.dc.sources.cache.sh(c,b,Date.now())).toJSON())}function Pk(a){return v(function*(){return a.db.O('pending-transactions')})}function Nk(a,b){return v(function*(){b.forEach(c=>a.files.delete(c));yield a.db.aa()})}
804
+ function Ok(a){return Object.entries(a).reduce((b,[c,d])=>b.set(c,gk(d)),new Map)}
805
+ olympe.dc.sources.cache.Lj=class{constructor(a,b,c){this.K=`Olympe_Cache_${a}`;this.H=b;this.O=new olympe.dc.sources.cache.ip;this.db=c.F(this.K);this.F=new Set;this.C=[];this.files=null;this.db.T('files').then(d=>{this.files=new Set(d);this.C.forEach(e=>e(null))}).catch(d=>{this.C.forEach(e=>e(d))});this.G=olympe.Y.Promise.nk(()=>{const d=this;return v(function*(){if(!(0===d.F.size||0<(yield Pk(d))))if(0<d.db.Z())d.G().then(()=>{}),d.H.debug('Offline DB GC: Postponing round while the stack is busy');
806
+ else{d.H.debug(`Offline DB GC: Round with ${d.F.size} candidates`);var e=Date.now();yield d.db.F().then(()=>{});d.H.debug(`Offline DB GC: has taken ${Date.now()-e}ms to run`)}})},5E3)}static ec(a){const b=new RegExp(`^(${olympe.dc.nc.Zc})>([a-z0-9]*)$`);for(const c of a.pb)if(a=c.match(b))return a[2];return null}executeQuery(a){const b=this;return v(function*(){const c=Date.now();b.H.debug(`Offline DB: Executing query ${a.V()} with source ${a.sb()}`);const d=olympe.dc.query.td.Ti(a),e=a.sb();var f=
807
+ yield b.db.get('instances',a.F),g=olympe.dc.sources.cache.wg.Qb(f);if(!g)return d;f=new Map;const h=new Set([g.tag]);d.create(g.tag,olympe.dc.sources.cache.Lj.ec(g),Ok(g.Dd));for(const p of uh(a))if(p instanceof olympe.dc.query.ta.xh){var k=p.relation;g=k.Ja()===olympe.dc.wa.ORIGIN;const q=k.X(),r=k.cc();k=new Set;f.set(p.V(),k);const t=[f.has(p.C)?new Set(f.get(p.C)):new Set([a.F])];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.H.warn(`Offline DB: Instance ${y} not found while processing query part, this should not happen`),
808
+ Promise.resolve([]);r.X();return b.db.K().then(z=>z.map(A=>olympe.dc.sources.cache.wg.Qb(A))).then(z=>{x.set(y,z)})})).then(()=>x);for(const [y,z]of l){p instanceof olympe.dc.query.ta.te&&p.G&&k.add(y);for(const A of z)if(l=A.tag,A.source===e){if(p instanceof olympe.dc.query.ta.te&&!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.Lj.ec(A),d.create(l,n,Ok(A.Dd)));q===olympe.dc.nc.Zc&&!0===g||d.Ha(q,g?l:y,g?y:l)}}}}else p instanceof
809
+ olympe.dc.query.ta.Rd&&b.H.warn(`Offline DB: Trying to execute a query ${a.V()} on the Cache DB that contains a FollowRule part. This is not supported and designed not to happen.`);b.H.C()&&(b.H.debug(`Offline DB: Data result for query ${a.V()}`,d.rc().C.size,'instances',Array.from(d.rc().xd()).length,'relations'),b.H.debug(`Offline DB: Data result for query ${a.V()} took ${Date.now()-c}ms to be executed`));return d})}};
810
+ olympe.dc.sources.cache.bq=class{constructor(a,b){this.name=a;this.C=b}static Qb(a){return a?new olympe.dc.sources.cache.bq(a.name,a.queryIds):null}toJSON(){return{name:this.name,queryIds:this.C}}};
811
+ olympe.dc.sources.cache.wg=class{constructor(a,b,c,d,e){this.tag=a;this.source=b;this.Dd=null!=c?c:{};this.pb=null!=d?d:[];this.C=null!=e?e:[]}static Qb(a){return a?new olympe.dc.sources.cache.wg(a.tag,a.source,a.props,a.relations,a.queryIds):null}toJSON(){return{tag:this.tag,source:this.source,props:this.Dd,relations:this.pb,queryIds:this.C}}};
812
+ olympe.dc.sources.cache.sh=class{constructor(a,b,c){this.F=a;this.C=b;this.timestamp=c}static Qb(a){return a?new olympe.dc.sources.cache.sh(a.destination,a.patch,a.timestamp):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp}}};
813
+ olympe.dc.sources.cache.Du=class extends olympe.dc.sources.cache.sh{constructor(a,b,c,d){super(a,b,c);this.error=d}static Qb(a){return a?new olympe.dc.sources.cache.Du(a.destination,a.patch,a.timestamp,a.error):null}toJSON(){return{destination:this.F,patch:this.C,timestamp:this.timestamp,error:this.error}}};
814
+ olympe.dc.sources.cache.Tl=class{constructor(a,b,c){this.tag=a;this.content=b;this.C=c}static Qb(a){return a?new olympe.dc.sources.cache.Tl(a.tag,a.content,a.mimetype):null}toJSON(){return{tag:this.tag,content:this.content,mimetype:this.C}}};function Qk(a,b){let c=a.O.get(b);c||(c=new Set(a.C.get(b).pb),a.O.set(b,c));return c}
815
+ olympe.dc.sources.cache.tt=class{constructor(a,b){this.H=a;this.G=b;this.C=new Map;this.T=new Set;this.Z=new Set;this.K=new olympe.dc.sources.cache.ip;this.O=new Map}bd(){this.T.forEach(a=>this.C.delete(a));Array.from(this.C.entries()).forEach(([a,b])=>{b||this.C.delete(a)});return this.C}Vc(a,b,c){const d=this.C.get(a);d||this.Z.add(a);var e;c=Array.from(null!=c?c:[]).reduce((h,k)=>{h[k[0]]=this.K.ha(k[1]);return h},null!=(e=null==d?void 0:d.Dd)?e:{});let f;e=null!=(f=null==d?void 0:d.C)?f:[];null===
816
+ this.G||e.includes(this.G)||e.push(this.G);let g;b=new olympe.dc.sources.cache.wg(a,b,c,null!=(g=null==d?void 0:d.pb)?g:[],e);this.C.set(a,b)}Rc(a,b){const c=this.C.get(a);if(c){var d;c.Dd=Array.from(b).reduce((e,[f,g])=>{null===g?delete e[f]:e[f]=this.K.ha(g);return e},null!=(d=c.Dd)?d:{})}else this.H.warn(`Trying to update an instance (${a}) which do not exists in the cache database: ignoring.`)}F(a){this.T.add(a)}Ha(a,b,c){var d;const e=null!=(d=this.C.get(b))?d:new olympe.dc.sources.cache.wg(b,
817
+ 'unknown',{},[],[]);var f;d=null!=(f=this.C.get(c))?f:new olympe.dc.sources.cache.wg(c,'unknown',{},[],[]);b=`${a}${olympe.dc.wa.ORIGIN}${b}`;f=(g,h)=>{this.C.set(g.tag,g);const k=Qk(this,g.tag);k.has(h)||(g.pb.push(h),k.add(h));null===this.G||g.C.includes(this.G)||g.C.push(this.G)};f(e,`${a}${olympe.dc.wa.DESTINATION}${c}`);f(d,b)}jc(a,b,c){const d=this.C.get(b),e=this.C.get(c);c=`${a}${olympe.dc.wa.DESTINATION}${c}`;a=`${a}${olympe.dc.wa.ORIGIN}${b}`;b=(f,g)=>{const h=Qk(this,f.tag);if(h.has(g)){const k=
818
+ f.pb.indexOf(g);f.pb.splice(k,1);h.delete(g)}};d&&b(d,c);e&&b(e,a)}};olympe.dc.sources.cache.tt.ya=[olympe.dc.Writable];olympe.dc.transaction={};olympe.dc.bi=class a{constructor(b,c){this.id=null!=b?b:olympe.Y.Nc();this.F=new olympe.D.Zb('BurstTransaction#'+this.id,c);this.vb=Rk(this);this.T=!1;this.F.onDestroy(()=>this.O());this.Z=new Set;this.G=new Map;this.K=new Set;this.C=null;let d;this.ab=null!=(d=olympe.W.getParameter(olympe.dc.transaction.U.Gn))?d:30;this.ka=[]}static C(b,c){return`${b},${c}`}Ib(b){for(const c of this.ka)c(b);this.stop()}Fa(){null!==this.C&&(clearTimeout(this.C),this.C=null);const b=this.ea(this.K);0<b.size&&Sk(this,
819
+ b,!1);this.K.clear()}ea(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.G.get(d))});return c}aa(b,c,d){this.ua(b,c,d);this.vb(b,c,d);null===this.C&&(this.C=setTimeout(this.Fa.bind(this),this.ab))}ua(b,c,d){b=a.C(b,c);this.G.set(b,d);this.K.add(b)}kb(b,c){return this.G.get(a.C(b,c))}push(b,c){const d=olympe.dc.ga(b);b=c.subscribe(e=>{for(const [f,g]of e)e=olympe.dc.ga(f),this.kb(d,e)!==g&&this.aa(d,e,g.valueOf())});this.Z.add(b)}complete(){return new Promise((b,
820
+ c)=>{this.O((d,e)=>{for(const f of this.Z)f.unsubscribe();d?b():c(e)})})}update(b,c,d){const e=olympe.dc.ga(b),f=olympe.dc.ga(c);void 0===e||void 0===f?olympe.ma.hb('dc').error('Burst transaction: instance tag or property tag is undefined'):(this.F.run(()=>{olympe.D.en([d],g=>{this.T=!0;if(g instanceof olympe.dc.vc)olympe.ma.hb('dc').error('Cannot send complex property values in burst transactions');else{var h;this.aa(e,f,null!=(h=null==g?void 0:g.valueOf())?h:null)}})}),this.F.Z(()=>{this.O()}))}stop(){this.F.destroy();
821
+ this.ka.length=0}getContext(){return this.F}V(){return this.id}Xg(){return!1}O(b){if(this.T){this.T=!1;null!==this.C&&(clearTimeout(this.C),this.C=null);this.K.clear();const c=this.ea(new Set(this.G.keys()));Sk(this,c,!0,b)}else null==b||b(!0)}toString(){return'Burst transaction #'+this.id}};olympe.dc.bi.prototype.complete=olympe.dc.bi.prototype.complete;olympe.dc.bi.prototype.push=olympe.dc.bi.prototype.push;olympe.dc.eq=class{C(){}toString(){}};olympe.dc.transaction.th=class a{constructor(b){this.F=null!=b?b:olympe.dc.Qa.SERVER}C(b,c){c=new olympe.dc.db.uc(c);this.G(b,c);return c}G(b,c){for(const d of b)switch(d.o){case 1:b=a.C(d.p||{});let e;c.Vc(d.t,null!=(e=d.s)?e:this.F,b,d.m);break;case 2:c.Rc(d.t,a.C(d.p),d.m);break;case 3:c.F(d.t,d.f,d.m);break;case 4:c.Ha(d.m,d.l,d.r,d.lm,d.rm);break;case 5:c.jc(d.m,d.l,d.r,d.lm,d.rm);break;case 6:break;default:throw Error('Undefined patch operation: '+d.o);}}static C(b){const c=new Map;for(const [d,
820
822
  e]of Object.entries(b)){b=d;let f=typeof e;20<b.length&&b.startsWith('fd')&&(b=olympe.dc.Oe.Me+b.substring(2));'object'===f&&(f=e&&e.c?String(e.c):'untyped');switch(f){case '1':case '2':case '3':throw Error('Complex format for primitive types not supported.');case 'string':c.set(b,String(e));break;case 'boolean':c.set(b,!!e);break;case 'number':c.set(b,Number(e));break;case '4':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d,e.h,e.m,e.s,e.S)));break;case '5':c.set(b,new Date(Date.UTC(e.y,e.M-1,e.d)));break;
821
- case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.Fc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function Sk(a,b){let c;return null!=(c=a.sources.get(b))?c:a.J.Ee(b)}function Tk(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Lc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Uk(a,b){let c;return null!=(c=a.G.get(b))?c:a.db.Gf(b)||!a.db.Ia(b)}function Vk(a,b){0===a.G.size?a.G=b:b.forEach((c,d)=>a.G.set(d,c))}function Wk(a){return Array.from(a.C.bd()).filter(b=>!b.yd()).map(b=>b.tag())}
822
- function Xk(a,b,c,d){d(a.C);c&&b!==olympe.dc.Qa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.xc(a.id),a.F.set(b,c)),d(c))}function Yk(a,b,c){const d=Sk(a,b),e=Uk(a,b),f=Tk(a,b);Xk(a,d,e,g=>{g.F(b,c,f)})}
823
- olympe.dc.transaction.Ku=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Mc();this.J=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.xc(this.id);this.sources=new Map;this.G=new Map}af(){return 0===this.C.C.size}Vc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.J.fromModel(b);c=Uk(this,a);this.sources.set(a,f);Xk(this,f,c,g=>{g.Vc(a,f,d,b)})}Qc(a,b){const c=Sk(this,a),d=Uk(this,a),e=Tk(this,a);Xk(this,c,d,f=>{f.Qc(a,null!=b?b:new Map,e)})}Ha(a,b,c){const d=Sk(this,b),
824
- e=Sk(this,c);var f=Uk(this,b)&&Uk(this,c)&&d!==olympe.dc.Qa.SELF&&e!==olympe.dc.Qa.SELF;f&&d!==e&&a!==olympe.dc.nc.Zc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ma.gb('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);Xk(this,d,f,g=>{g.Ha(a,b,c,Tk(this,b),Tk(this,c))})}jc(a,b,c){const d=Sk(this,b),e=Sk(this,c);let f=Uk(this,
825
- b)&&Uk(this,c)&&d!==olympe.dc.Qa.SELF&&e!==olympe.dc.Qa.SELF;f&&d!==e&&a!==olympe.dc.nc.Zc&&(olympe.ma.gb('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Xk(this,d,f,g=>{g.jc(a,b,c,Tk(this,b),Tk(this,c))})}};function Zk(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.sp.Sq)if(e===olympe.dc.Qa.SELF)d[g]=olympe.dc.ia().V();else{if(e===olympe.dc.Qa.SERVER)continue}else g.startsWith(olympe.dc.Oe.Me)&&(g='fd'+g.substring(1));e=a.T(e);c&&e instanceof Object&&8===e.c?a.O.set(g,e):d[g]=e}return d}function $k(a){if(0===a.O.size)return null;const b=Object.create(null);a.O.forEach((c,d)=>{b[d]=c});a.O.clear();return b}
826
- class al{constructor(){this.O=new Map}T(a){return a instanceof olympe.D.Oa||a instanceof olympe.D.fa||a instanceof olympe.D.ba?a.valueOf():a instanceof Date||a instanceof olympe.D.ib?(a=a instanceof olympe.D.ib?a.valueOf():a,{c:4,y:a.getUTCFullYear(),M:a.getUTCMonth()+1,d:a.getUTCDate(),h:a.getUTCHours(),m:a.getUTCMinutes(),s:a.getUTCSeconds(),S:a.getUTCMilliseconds(),z:0}):a instanceof olympe.D.Color?{c:7,r:a.Sg().valueOf(),g:a.Pg().valueOf(),b:a.Mg().valueOf(),a:a.Lg().valueOf()}:a&&'function'===
827
- typeof a.X?{c:8,t:a.X()}:a}}function nf(a){const b=a.J.concat(a.G).concat(a.O).concat(a.C).concat(a.T);a.O=[];a.G=[];a.C=[];a.T=[];a.J=[];return b}
828
- olympe.dc.transaction.Tf=class{constructor({Ik:a=!1,Hh:b=!0,fe:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.J=[];this.Ik=null!=a?a:!1;this.fe=null!=c?c:!0;this.Hh=null!=b?b:!0;this.Z=olympe.D?new al:new class extends al{T(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(nf(this))}Vc(a,b,c,d=null){c=Zk(this.Z,null!=c?c:null,this.Ik);c={o:1,t:a,p:c};this.Hh&&(c.s=b);this.fe&&d&&(c.m=d);this.O.push(c);this.Ik&&(b=$k(this.Z))&&this.C.push({o:2,t:a,p:b})}Qc(a,
829
- b,c=null){b=Zk(this.Z,b||null,!1);a={o:2,t:a,p:b};this.fe&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.fe&&c&&(a.m=c);this.G.push(a)}Ha(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.T.push(a)}jc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
830
- if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.fe&&d&&(a.lm=d);this.fe&&e&&(a.rm=e);this.J.push(a)}};olympe.dc.transaction.Tf.ya=[olympe.dc.Writable];function bl(a){var b=new olympe.dc.Wa;b.T=a;return b}function cl(a,b){b instanceof olympe.dc.Wa&&b.F.forEach((c,d)=>a.F.set(d,c));a.Xa.push(b);return b}
831
- function dl(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();cl(a,new olympe.dc.transaction.Xa.xo(e,b));cl(a,new olympe.dc.transaction.Xa.gl(e,b,d));return c}
832
- 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.Z,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
833
- olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.Y.Mc();this.Xa=[];this.G=new Map;this.T=!0;this.F=new Map;this.Z=[];this.J=!1;this.O=[...olympe.dc.Yi().Z]}V(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ia().model(a)}C(a){Vk(a,this.F);for(const b of this.Xa)b.C(a);try{this.O.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=cl(this,new olympe.dc.transaction.Xa.jo(a,b));const c=b.X();this.G.set(c,
834
- olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.T);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ia();this.F.set(c,b);if(b){let f;b=null!=(f=this.G.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.Xd().fromModel(b);cl(this,new olympe.dc.transaction.Xa.Lu(c,d))}else{if((e=d.Ia(c))&&d.Gf(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
835
- if(!e&&!this.G.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.Ob.Cc){cl(this,new olympe.dc.transaction.Xa.yo(a,b))}update(a,b,c){return cl(this,new olympe.dc.transaction.Xa.Hv(a,b,c))}Ha(a,b,c){cl(this,new olympe.dc.transaction.Xa.gl(a,b,c))}jc(a,b,c){cl(this,new olympe.dc.transaction.Xa.at(a,b,c))}Jm(a,b){cl(this,new olympe.dc.transaction.Xa.xo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
836
- f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Oe.Me+d.X(),e);this.Ha(olympe.dc.CloudObject.propertyRel,a,d);this.Ha(olympe.dm.Property.typeRel,d,b);this.Ha(olympe.dc.CloudObject.containsRel,a,d);return d}Br(a,b,c='',{hD:d=olympe.dm.Relation.J.yu,sD:e=olympe.dm.Relation.C.vq,nD:f=olympe.dm.Relation.C.Cs,QD:g=olympe.dm.Relation.C.tt,eD:h=olympe.dm.Ok.NONE,PD:k=olympe.dm.Relation.O|h}={},l=olympe.Y.Mc()){c=Z(Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
837
- c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.aa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ka,g),olympe.dm.Relation.T,h);this.Ha(olympe.dc.CloudObject.cj,a,c);this.Ha(olympe.dm.Relation.destinationModelRel,c,b);this.Ha(olympe.dc.CloudObject.containsRel,a,c);return c}Xg(){return!1}Cm(a){this.Z.push(olympe.D.$a().G(a))}ob(a,b){fl(olympe.dc.Yi(),this,el(this,a),b)}Km(a){a=el(this,a);gl(olympe.dc.Yi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};
838
- olympe.dc.Wa.ya=[olympe.dc.cq];function Qk(a){var b=olympe.dc.Yi();const c=a.V();b.J.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.xc(c);g.Qc(d,(new Map).set(e,f),b.db.model(d));b.C.wc($e(g,Infinity))}}
839
- function Rk(a,b,c,d){var e=olympe.dc.Yi();const f=olympe.dc.Request.C.$h,g=olympe.dc.Request.C.ah,h=a.V();a=a.Xg();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Qa.SELF||!e.db.Gf(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.xc(h),k.set(n,p));p.Qc(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.Hi(n,a)),b=e.Yb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.C.wc($e(n,p));null==d||d(!0)})}
840
- function fl(a,b,c,d){if(d){const e=b.V();a.F.set(e,c);gl(a,b,(f,g)=>{f||(a.F.delete(e),c(f,g))},!1)}else gl(a,b,c,!1)}function hl(a){const b=olympe.dc.Request.C.yj;lf(a.Yb,olympe.dc.Request.C.Hn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.V(),f=a.J.get(e);void 0!==f&&(a.J.delete(e),f.Ib(d));a.C.wc(c);a.H.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});lf(a.Yb,b,c=>{c=c.content;il(a,c.id,c.finalize,c.error)})}
841
- function jl(a,b,c){c&&a.ka.has(c)||a.Z.push(b);return a}
842
- function gl(a,b,c,d=!1){const e=b.V(),f=new olympe.dc.transaction.Ku(a.db,a.ea,e);try{b.C(f)}catch(p){c(!1,p.message);return}if(f.af()){c(!0);var g;null==(g=a.F.get(e))||g(!0);a.F.delete(e)}else{a.G.set(e,[]);var h=Wk(f);a.C.C.kb(h);g=h.filter(p=>Uk(f,p));var k=gg(a.C,f.C,g),l=olympe.D.$a().G((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.F.size+1);return ml(a,f.F,d,b.Xg())}).then(p=>{n.forEach(q=>q(p));il(a,e,olympe.dc.transaction.sf.C.vi)}).catch(p=>{a.H.error(p);n.forEach(q=>
843
- q(null,`${p}`));nl(a,e)})}}
844
- function kl(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Rb(n,olympe.dm.File)&&void 0!==(null==(p=d.Lc(n))?void 0:p.Ra(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],l=olympe.Y.Ye();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.G(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
845
- r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.ua.ea(u,q,y,z=>{const A=h.reduce((B,O)=>B||O.Lc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Bm(z),k.push([u,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.H.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.Qc(q,r);return p},
846
- new olympe.dc.db.xc);return gg(a.C,n)})}function ll(a,b,c,d){const e=olympe.D.Og(),f=new olympe.async.Oj(e);0<a.T&&f.qn(a.T);const g=olympe.dc.transaction.sf.C.uu;let h=!0;const k=a.G.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});Rc(f,(l,n)=>{l||a.H.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.C.C.Ib(c);nl(a,b)});f.start()}
847
- function ml(a,b,c,d){if(c&&olympe.D.Ma(a.aa.F)!==olympe.auth.Sa.C.df)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const e=c?olympe.dc.Request.C.Ig:olympe.dc.Request.C.Ve;return Promise.all(Array.from(b).map(([f,g])=>a.Yb.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.Hi(g,d))))).then(f=>f[0])}function il(a,b,c,d){let e,f;null==(f=null==(e=a.G.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}
848
- function nl(a,b){var c;null==(c=a.G.get(b))||c.forEach(d=>{d(olympe.dc.transaction.sf.C.vi,null)});a.G.delete(b);if(0===a.G.size){for(const d of a.O)d();a.O=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0))}function ol(a,b){if(0<a.G.size){const c=olympe.D.$a();a.O.push(()=>{!c.eb()&&c.run(b)})}else b()}
849
- olympe.dc.transaction.sf=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=b;this.db=b.view;this.Yb=c;this.ea=d;this.ua=e;this.aa=f;this.T=g.get('notificationTimeout');this.Z=[];let h;this.ka=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.J=new olympe.Y.Ah(g.get('burstHoldTime'));this.G=new Map;this.O=[];this.F=new Map;this.Fa=new olympe.Y.promise.im;hl(this)}me(a){gb(this.Fa,()=>this.Yb.request(new olympe.dc.Request(olympe.dc.Request.C.Uo,olympe.dc.Qa.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
850
- b.redo_stack_size)}).catch(b=>this.H.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.sf.C={Ll:0,vi:1,uu:2};olympe.dc.transaction.Hi=class{constructor(a,b=!1){this.C=a;this.F=b}Xg(){return this.F}uc(){return this.C}};olympe.dc.transaction.R={Ca:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.U={Np:'dc.transaction.timeout',Gn:'dc.transaction.burstInterval',so:'dc.transaction.disabledCompilers'};
851
- olympe.W.config(function(a){F(a,olympe.dc.transaction.U.Np,9E4);F(a,olympe.dc.transaction.U.Gn,30);F(a,olympe.dc.transaction.U.so,[]);E(a,olympe.dc.transaction.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.ja(olympe.dc.transaction.U.Np),new olympe.W.ja(olympe.dc.transaction.U.so),new olympe.W.ja(olympe.dc.db.U.bl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.R.Ea,olympe.dc.transaction.sf,
852
- olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ea,olympe.dc.R.Ag,olympe.dc.sources.R.Se,olympe.dc.R.wj,olympe.auth.R.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Xa={};function pl(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ma(e));return c}olympe.dc.transaction.Xa.ig=class{constructor(){this.ia=olympe.dc.ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ma(a){a=olympe.D.Ma(a);return void 0===a||null===a?null:olympe.D.Wr(a)?a.valueOf():a}};olympe.dc.transaction.Xa.ig.ya=[olympe.dc.cq];olympe.dc.transaction.Xa.zn=class extends olympe.dc.transaction.Xa.ig{constructor(a,b){super();this.relation=a instanceof olympe.dc.Na.Relation?a:new olympe.dc.Na.Relation(olympe.dc.ga(a));this.origin=this.ia.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ja(){return this.relation.Ja()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.Dd.set(olympe.dc.ga(b),c);return a}olympe.dc.transaction.Xa.jo=class extends olympe.dc.transaction.Xa.ig{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ga(b))?c:olympe.Y.zf();this.model=olympe.dc.ga(a);this.source=null;this.Dd=new Map}X(){return this.tag}ec(){return this.model}Uh(a){this.source=a;return this}C(a){const b=this.ec(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Vc(c,b,this.source,pl(this,this.Dd))}toString(){return`CreateInstance(${this.ec()}, ${this.X()})`}};
823
+ case '6':c.set(b,new Date(Date.UTC(e.y||1970,e.M&&e.M-1||0,e.d||1,e.h,e.m,e.s,e.S)));break;case '7':c.set(b,new olympe.D.Color(e.r,e.g,e.b,e.a));break;case '8':c.set(b,new olympe.dc.vc(e.t));break;case 'untyped':null===e&&c.set(b,null)}}return c}};function Tk(a,b){let c;return null!=(c=a.sources.get(b))?c:a.K.Ee(b)}function Uk(a,b){let c,d,e;return null!=(e=null!=(d=null==(c=a.C.Mc(b))?void 0:c.Wb())?d:a.db.model(b))?e:null}function Vk(a,b){let c;return null!=(c=a.G.get(b))?c:a.db.Hf(b)||!a.db.Ia(b)}function Wk(a,b){0===a.G.size?a.G=b:b.forEach((c,d)=>a.G.set(d,c))}function Xk(a){return Array.from(a.C.bd()).filter(b=>!b.yd()).map(b=>b.tag())}
824
+ function Yk(a,b,c,d){d(a.C);c&&b!==olympe.dc.Qa.SELF&&(c=a.F.get(b),c||(c=new olympe.dc.db.uc(a.id),a.F.set(b,c)),d(c))}function Zk(a,b,c){const d=Tk(a,b),e=Vk(a,b),f=Uk(a,b);Yk(a,d,e,g=>{g.F(b,c,f)})}
825
+ olympe.dc.transaction.Lu=class{constructor(a,b,c){this.id=null!=c?c:olympe.Y.Nc();this.K=b;this.db=a;this.F=new Map;this.C=new olympe.dc.db.uc(this.id);this.sources=new Map;this.G=new Map}af(){return 0===this.C.C.size}Vc(a,b,c,d){let e;const f=null!=(e=null!=c?c:this.sources.get(a))?e:this.K.fromModel(b);c=Vk(this,a);this.sources.set(a,f);Yk(this,f,c,g=>{g.Vc(a,f,d,b)})}Rc(a,b){const c=Tk(this,a),d=Vk(this,a),e=Uk(this,a);Yk(this,c,d,f=>{f.Rc(a,null!=b?b:new Map,e)})}Ha(a,b,c){const d=Tk(this,b),
826
+ e=Tk(this,c);var f=Vk(this,b)&&Vk(this,c)&&d!==olympe.dc.Qa.SELF&&e!==olympe.dc.Qa.SELF;f&&d!==e&&a!==olympe.dc.nc.Zc&&(f=g=>{let h;return null!=(h=olympe.dc.ia().name(g))?h:g},olympe.ma.hb('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);Yk(this,d,f,g=>{g.Ha(a,b,c,Uk(this,b),Uk(this,c))})}jc(a,b,c){const d=Tk(this,b),e=Tk(this,c);let f=Vk(this,
827
+ b)&&Vk(this,c)&&d!==olympe.dc.Qa.SELF&&e!==olympe.dc.Qa.SELF;f&&d!==e&&a!==olympe.dc.nc.Zc&&(olympe.ma.hb('dc').warn(`Try to delete a relation between 2 objects that have different locations: ${b}-[${a}]->${c}`),f=!1);Yk(this,d,f,g=>{g.jc(a,b,c,Uk(this,b),Uk(this,c))})}};function $k(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.tp.Tq)if(e===olympe.dc.Qa.SELF)d[g]=olympe.dc.ia().V();else{if(e===olympe.dc.Qa.SERVER)continue}else g.startsWith(olympe.dc.Oe.Me)&&(g='fd'+g.substring(1));e=a.T(e);c&&e instanceof Object&&8===e.c?a.O.set(g,e):d[g]=e}return d}function al(a){if(0===a.O.size)return null;const b=Object.create(null);a.O.forEach((c,d)=>{b[d]=c});a.O.clear();return b}
828
+ class bl{constructor(){this.O=new Map}T(a){return a instanceof olympe.D.Oa||a instanceof olympe.D.fa||a instanceof olympe.D.ba?a.valueOf():a instanceof Date||a instanceof olympe.D.fb?(a=a instanceof olympe.D.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.D.Color?{c:7,r:a.Sg().valueOf(),g:a.Pg().valueOf(),b:a.Mg().valueOf(),a:a.Lg().valueOf()}:a&&'function'===
829
+ typeof a.X?{c:8,t:a.X()}:a}}function nf(a){const b=a.K.concat(a.G).concat(a.O).concat(a.C).concat(a.T);a.O=[];a.G=[];a.C=[];a.T=[];a.K=[];return b}
830
+ olympe.dc.transaction.pf=class{constructor({Ik:a=!1,Ih:b=!0,ee:c=!0}={}){this.O=[];this.G=[];this.C=[];this.T=[];this.K=[];this.Ik=null!=a?a:!1;this.ee=null!=c?c:!0;this.Ih=null!=b?b:!0;this.Z=olympe.D?new bl:new class extends bl{T(d){return d&&'function'===typeof d.X?{c:8,t:d.X()}:d}}}flush(){return JSON.stringify(nf(this))}Vc(a,b,c,d=null){c=$k(this.Z,null!=c?c:null,this.Ik);c={o:1,t:a,p:c};this.Ih&&(c.s=b);this.ee&&d&&(c.m=d);this.O.push(c);this.Ik&&(b=al(this.Z))&&this.C.push({o:2,t:a,p:b})}Rc(a,
831
+ b,c=null){b=$k(this.Z,b||null,!1);a={o:2,t:a,p:b};this.ee&&c&&(a.m=c);this.C.push(a)}F(a,b,c=null){a={o:3,t:a,f:b};this.ee&&c&&(a.m=c);this.G.push(a)}Ha(a,b,c,d=null,e=null){if(!a)throw Error('Cannot create relation of undefined type');if(!b)throw Error(`Cannot create relation ${a} from undefined origin to ${c}`);if(!c)throw Error(`Cannot create relation ${a} from ${b} to undefined destination`);a={o:4,m:a,l:b,r:c};this.ee&&d&&(a.lm=d);this.ee&&e&&(a.rm=e);this.T.push(a)}jc(a,b,c,d=null,e=null){if(!a)throw Error('Cannot delete relation of undefined type');
832
+ if(!b)throw Error('Cannot delete relation with undefined origin');if(!c)throw Error('Cannot delete relation with undefined destination');a={o:5,m:a,l:b,r:c};this.ee&&d&&(a.lm=d);this.ee&&e&&(a.rm=e);this.K.push(a)}};olympe.dc.transaction.pf.ya=[olympe.dc.Writable];function cl(a){var b=new olympe.dc.Wa;b.T=a;return b}function dl(a,b){b instanceof olympe.dc.Wa&&b.F.forEach((c,d)=>a.F.set(d,c));a.Xa.push(b);return b}
833
+ function el(a,b,c,d){c=a.create(null!=c?c:olympe.dc.CloudObject,void 0);if('string'===typeof b)b=b||'',Z(c,olympe.dc.CloudObject.nameProp.X(),b);else for(const [f,g]of Object.entries(b))Z(c,f,g);b=c.X();d=null!=d?d:olympe.dc.CloudObject;const e=olympe.dc.CloudObject.extendRel.X();dl(a,new olympe.dc.transaction.Xa.xo(e,b));dl(a,new olympe.dc.transaction.Xa.gl(e,b,d));return c}
834
+ function fl(a,b){if(a.K)throw Error('Operation not permitted: this transaction has already been executed');a.K=!0;const c=[d=>{a.K=d},...a.Z,null!=b?b:()=>{}];return(d,e)=>{c.forEach(f=>f(d,e))}}
835
+ olympe.dc.Wa=class{constructor(a){this.id=null!=a?a:olympe.Y.Nc();this.Xa=[];this.G=new Map;this.T=!0;this.F=new Map;this.Z=[];this.K=!1;this.O=[...olympe.dc.Yi().Z]}V(){return this.id}model(a){let b;return null!=(b=this.G.get(olympe.dc.ga(a)))?b:olympe.dc.ia().model(a)}C(a){Wk(a,this.F);for(const b of this.Xa)b.C(a);try{this.O.forEach(b=>b(a))}catch(b){throw Error(`Transaction compilation error: ${b.message}`);}}create(a,b){b=dl(this,new olympe.dc.transaction.Xa.jo(a,b));const c=b.X();this.G.set(c,
836
+ olympe.dc.ga(a));let d;this.persist(c,null!=(d=this.F.get(c))?d:this.T);return b}persist(a,b=!0){const c=olympe.dc.ga(a);var d=olympe.dc.ia();this.F.set(c,b);if(b){let f;b=null!=(f=this.G.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.Xd().fromModel(b);dl(this,new olympe.dc.transaction.Xa.Mu(c,d))}else{if((e=d.Ia(c))&&d.Hf(c))throw Error(`Try to remove persistence of an instance already persisted: ${c}`);
837
+ if(!e&&!this.G.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.Ob.Dc){dl(this,new olympe.dc.transaction.Xa.yo(a,b))}update(a,b,c){return dl(this,new olympe.dc.transaction.Xa.Iv(a,b,c))}Ha(a,b,c){dl(this,new olympe.dc.transaction.Xa.gl(a,b,c))}jc(a,b,c){dl(this,new olympe.dc.transaction.Xa.bt(a,b,c))}Jm(a,b){dl(this,new olympe.dc.transaction.Xa.xo(a,b))}defineProperty(a,b,c,d,e,f){d=this.create(olympe.dm.Property,
838
+ f);Z(d,olympe.dc.CloudObject.nameProp,c||'');void 0!==e&&this.update(a,olympe.dc.Oe.Me+d.X(),e);this.Ha(olympe.dc.CloudObject.propertyRel,a,d);this.Ha(olympe.dm.Property.typeRel,d,b);this.Ha(olympe.dc.CloudObject.containsRel,a,d);return d}Cr(a,b,c='',{iD:d=olympe.dm.Relation.K.zu,tD:e=olympe.dm.Relation.C.wq,oD:f=olympe.dm.Relation.C.Ds,RD:g=olympe.dm.Relation.C.ut,fD:h=olympe.dm.Ok.NONE,QD:k=olympe.dm.Relation.O|h}={},l=olympe.Y.Nc()){c=Z(Z(Z(Z(Z(Z(Z(Z(Z(this.create(olympe.dm.Relation,l),olympe.dc.CloudObject.nameProp,
839
+ c||''),olympe.dm.Relation.F,d),olympe.dm.Relation.G,k),olympe.dm.Relation.ea,e),olympe.dm.Relation.ua,e),olympe.dm.Relation.aa,e),olympe.dm.Relation.Z,f),olympe.dm.Relation.ka,g),olympe.dm.Relation.T,h);this.Ha(olympe.dc.CloudObject.cj,a,c);this.Ha(olympe.dm.Relation.destinationModelRel,c,b);this.Ha(olympe.dc.CloudObject.containsRel,a,c);return c}Xg(){return!1}Cm(a){this.Z.push(olympe.D.$a().G(a))}ob(a,b){gl(olympe.dc.Yi(),this,fl(this,a),b)}Km(a){a=fl(this,a);hl(olympe.dc.Yi(),this,a,!0)}toString(){return`Transaction #${this.id}`}};
840
+ olympe.dc.Wa.ya=[olympe.dc.eq];function Rk(a){var b=olympe.dc.Yi();const c=a.V();b.K.set(c,a);return(d,e,f)=>{const g=new olympe.dc.db.uc(c);g.Rc(d,(new Map).set(e,f),b.db.model(d));b.C.yc($e(g,Infinity))}}
841
+ function Sk(a,b,c,d){var e=olympe.dc.Yi();const f=olympe.dc.Request.C.ai,g=olympe.dc.Request.C.ah,h=a.V();a=a.Xg();const k=new Map;for(const l of b.keys()){const n=e.db.source(l);if(n===olympe.dc.Qa.SELF||!e.db.Hf(l))continue;let p=k.get(n);p||(p=new olympe.dc.db.uc(h),k.set(n,p));p.Rc(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.Hi(n,a)),b=e.Yb.request(b).catch(p=>null==d?void 0:d(!1,`${p}`)),c&&b.then(p=>{e.C.yc($e(n,p));null==d||d(!0)})}
842
+ function gl(a,b,c,d){if(d){const e=b.V();a.F.set(e,c);hl(a,b,(f,g)=>{f||(a.F.delete(e),c(f,g))},!1)}else hl(a,b,c,!1)}function il(a){const b=olympe.dc.Request.C.yj;lf(a.Yb,olympe.dc.Request.C.Hn,c=>{var d=c.content;c=d.rollback;d=d.error;const e=c.V(),f=a.K.get(e);void 0!==f&&(a.K.delete(e),f.Ib(d));a.C.yc(c);a.H.warn(`Burst update (id=${e}) has been refused and is rolled back. Error: ${d}`)});lf(a.Yb,b,c=>{c=c.content;jl(a,c.id,c.finalize,c.error)})}
843
+ function kl(a,b,c){c&&a.ka.has(c)||a.Z.push(b);return a}
844
+ function hl(a,b,c,d=!1){const e=b.V(),f=new olympe.dc.transaction.Lu(a.db,a.ea,e);try{b.C(f)}catch(p){c(!1,p.message);return}if(f.af()){c(!0);var g;null==(g=a.F.get(e))||g(!0);a.F.delete(e)}else{a.G.set(e,[]);var h=Xk(f);a.C.C.kb(h);g=h.filter(p=>Vk(f,p));var k=gg(a.C,f.C,g),l=olympe.D.$a().G((p,q)=>c(null!==p,q)),n=[k,l];ll(a,f,g).then(p=>{n.splice(1,0,p);ml(a,e,h,f.F.size+1);return nl(a,f.F,d,b.Xg())}).then(p=>{n.forEach(q=>q(p));jl(a,e,olympe.dc.transaction.tf.C.wi)}).catch(p=>{a.H.error(p);n.forEach(q=>
845
+ q(null,`${p}`));ol(a,e)})}}
846
+ function ll(a,b,c){const d=b.C,e=olympe.dm.File.urlProp.X();c=c.filter(n=>{let p;return a.db.Sb(n,olympe.dm.File)&&void 0!==(null==(p=d.Mc(n))?void 0:p.Ra(e))}).map(olympe.dc.CloudObject.get);if(0===c.length)return Promise.resolve(()=>{});const f=olympe.dm.File.C.X(),g=olympe.dm.File.modificationDateProp.X(),h=Array.from(b.F.values()),k=[],l=olympe.Y.Ye();return Promise.all(c.map(n=>{const p=n.get(e);if(p.startsWith('blob:'))return l.G(p).then(q=>new Promise((r,t)=>{if(null===q)URL.revokeObjectURL(p),
847
+ r();else{var u=n.X(),x,y=null!=(x=n.get(olympe.dm.File.mimeTypeProp))?x:'application/data';a.ua.ea(u,q,y,z=>{const A=h.reduce((B,O)=>B||O.Mc(u),null);null!==A&&(z=(new Map).set(e,z).set(f,!0).set(g,new Date),A.Bm(z),k.push([u,z]));URL.revokeObjectURL(p);r()},t)}}));2048<p.length&&a.H.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.Rc(q,r);return p},
848
+ new olympe.dc.db.uc);return gg(a.C,n)})}function ml(a,b,c,d){const e=olympe.D.Og(),f=new olympe.async.Oj(e);0<a.T&&f.qn(a.T);const g=olympe.dc.transaction.tf.C.vu;let h=!0;const k=a.G.get(b);for(let l=0;l<d;l++)f.add((n,p)=>{k.push(e.G((q,r)=>{h&&(h=q!==g);r?p(r):n()}))});Rc(f,(l,n)=>{l||a.H.warn(`An error occurred while processing the notification of transaction (${b}): ${n}.`);h&&a.C.C.Ib(c);ol(a,b)});f.start()}
849
+ function nl(a,b,c,d){if(c&&olympe.D.Ma(a.aa.F)!==olympe.auth.Sa.C.df)return Promise.reject('Cannot persist with batch transactions API if not authenticated (aka: `Transaction.executeAsLarge()`).');const e=c?olympe.dc.Request.C.Ig:olympe.dc.Request.C.Ve;return Promise.all(Array.from(b).map(([f,g])=>a.Yb.request(new olympe.dc.Request(e,f,new olympe.dc.transaction.Hi(g,d))))).then(f=>f[0])}function jl(a,b,c,d){let e,f;null==(f=null==(e=a.G.get(b))?void 0:e.pop())||f(c,null!=d?d:null)}
850
+ function ol(a,b){var c;null==(c=a.G.get(b))||c.forEach(d=>{d(olympe.dc.transaction.tf.C.wi,null)});a.G.delete(b);if(0===a.G.size){for(const d of a.O)d();a.O=[]}a.F.has(b)&&(c=a.F.get(b),a.F.delete(b),c(!0))}function pl(a,b){if(0<a.G.size){const c=olympe.D.$a();a.O.push(()=>{!c.eb()&&c.run(b)})}else b()}
851
+ olympe.dc.transaction.tf=class{constructor(a,b,c,d,e,f,g){this.H=a;this.C=b;this.db=b.view;this.Yb=c;this.ea=d;this.ua=e;this.aa=f;this.T=g.get('notificationTimeout');this.Z=[];let h;this.ka=new Set(null!=(h=g.get('disabledCompilers'))?h:[]);this.K=new olympe.Y.Bh(g.get('burstHoldTime'));this.G=new Map;this.O=[];this.F=new Map;this.Fa=new olympe.Y.promise.im;il(this)}le(a){gb(this.Fa,()=>this.Yb.request(new olympe.dc.Request(olympe.dc.Request.C.Uo,olympe.dc.Qa.SERVER)).then(b=>{a(b.ids,b.undo_stack_size,
852
+ b.redo_stack_size)}).catch(b=>this.H.error('Failed to process get stack request',b))).then(()=>{})}};olympe.dc.transaction.tf.C={Ll:0,wi:1,vu:2};olympe.dc.transaction.Hi=class{constructor(a,b=!1){this.C=a;this.F=b}Xg(){return this.F}rc(){return this.C}};olympe.dc.transaction.R={Ca:'dc.transaction.Logger',Ea:'dc.transaction.Manager'};olympe.dc.transaction.U={Op:'dc.transaction.timeout',Gn:'dc.transaction.burstInterval',so:'dc.transaction.disabledCompilers'};
853
+ olympe.W.config(function(a){F(a,olympe.dc.transaction.U.Op,9E4);F(a,olympe.dc.transaction.U.Gn,30);F(a,olympe.dc.transaction.U.so,[]);E(a,olympe.dc.transaction.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('dc'));E(a,'olympe.dc.transaction.Config',[new olympe.W.ja(olympe.dc.transaction.U.Op),new olympe.W.ja(olympe.dc.transaction.U.so),new olympe.W.ja(olympe.dc.db.U.bl)],(b,c,d)=>new Map([['notificationTimeout',b],['disabledCompilers',c],['burstHoldTime',d]]));D(a,olympe.dc.transaction.R.Ea,olympe.dc.transaction.tf,
854
+ olympe.dc.transaction.R.Ca,olympe.dc.db.R.Ea,olympe.dc.R.Ag,olympe.dc.sources.R.Se,olympe.dc.R.wj,olympe.auth.R.Ea,'olympe.dc.transaction.Config')},'olympe.dc.transaction');olympe.dc.transaction.Xa={};function ql(a,b){const c=new Map;for(const [d,e]of b)c.set(d,a.Ma(e));return c}olympe.dc.transaction.Xa.ig=class{constructor(){this.ia=olympe.dc.ia()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}Ma(a){a=olympe.D.Ma(a);return void 0===a||null===a?null:olympe.D.Xr(a)?a.valueOf():a}};olympe.dc.transaction.Xa.ig.ya=[olympe.dc.eq];olympe.dc.transaction.Xa.zn=class extends olympe.dc.transaction.Xa.ig{constructor(a,b){super();this.relation=a instanceof olympe.dc.Na.Relation?a:new olympe.dc.Na.Relation(olympe.dc.ga(a));this.origin=this.ia.Ia(b)?olympe.dc.CloudObject.get(b):b}getType(){return this.relation.X()}Ja(){return this.relation.Ja()}C(){throw Error('Abstract method build() not override !');}toString(){throw Error('Abstract method toString() not override !');}};function Z(a,b,c){a.Dd.set(olympe.dc.ga(b),c);return a}olympe.dc.transaction.Xa.jo=class extends olympe.dc.transaction.Xa.ig{constructor(a,b){super();let c;this.tag=null!=(c=b&&olympe.dc.ga(b))?c:olympe.Y.Af();this.model=olympe.dc.ga(a);this.source=null;this.Dd=new Map}X(){return this.tag}ec(){return this.model}Vh(a){this.source=a;return this}C(a){const b=this.ec(),c=this.X();if(!b)throw Error('OperationError: Cannot create instance, model tag is undefined');a.Vc(c,b,this.source,ql(this,this.Dd))}toString(){return`CreateInstance(${this.ec()}, ${this.X()})`}};
853
855
  olympe.dc.transaction.Xa.jo.ya=[olympe.dc.Ne];olympe.dc.transaction.Xa.gl=class extends olympe.dc.transaction.Xa.zn{constructor(a,b,c){super(a,b);this.F=this.ia.Ia(c)?olympe.dc.CloudObject.get(c):c}C(a){const b=this.getType();if(''===b)throw Error('OperationError: Cannot create relation, type is undefined, null or empty string');if(b===olympe.dc.nc.Zc)throw Error('OperationError: Cannot create the instance -> model relation');if(!this.origin)throw Error('OperationError: Cannot create relation, origin tag is undefined, null or empty string');
854
- if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ja()===olympe.dc.wa.DESTINATION?a.Ha(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ha(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ja()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Xa.zz=class extends olympe.dc.transaction.Xa.ig{constructor(a,b=olympe.dc.Ob.Cc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}C(a){for(const b of this.ia.bd(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Xa.yo(b,this.Pb)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Xa.xo=class extends olympe.dc.transaction.Xa.zn{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(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.wa.DESTINATION?
855
- a.jc(b,c,f):a.jc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ja()}${this.getType()})`}};olympe.dc.transaction.Xa.yo=class extends olympe.dc.transaction.Xa.ig{constructor(a,b=olympe.dc.Ob.Cc){super();this.tag=this.ia.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ia(b)&&Yk(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Xa.at=class extends olympe.dc.transaction.Xa.gl{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ga(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
856
- this.relation.Ja()===olympe.dc.wa.DESTINATION?a.jc(b,c,d):a.jc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ja()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Xa.Hv=class extends olympe.dc.transaction.Xa.ig{constructor(a,b,c){super();this.tag=this.ia.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Dd=new Map;void 0!==b&&this.Dd.set(olympe.dc.ga(b),c)}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Lc(b))&&c.F()||this.ia.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=pl(this,this.Dd);
857
- for(const [e,f]of c){var d=this.ia.Ra(b,e,!0);d instanceof olympe.dc.Fc&&Yk(a,d.X(),olympe.dc.Ob.Cc);f instanceof olympe.dc.Fc&&!Uk(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.C(a))}a.Qc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+pl(this,this.Dd)+')'}};olympe.dc.transaction.Xa.Lu=class a extends olympe.dc.transaction.Xa.ig{constructor(b,c){super();this.tag=b;this.source=c}C(b){const c=olympe.dc.ia();if(Uk(b,this.tag)&&c.Ia(this.tag)&&!c.Gf(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.C.Lc(this.tag))?void 0:d.Cb())||f.forEach((g,h)=>{e.set(h,g)});for(const g of e.values())g instanceof olympe.dc.Fc&&c.Ia(g.X())&&(new a(g.X(),this.source)).C(b);d=c.model(this.tag);b.Vc(this.tag,d,this.source,e);for(const [g,h,k]of Ig(c,this.tag))Uk(b,
858
- k)&&(h===olympe.dc.wa.ORIGIN?b.Ha(g,k,this.tag):b.Ha(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ga=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Kg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.oa.ec(a))?d:''}else if(olympe.D.bf(a)){let d;b=olympe.dc.ga(null==(d=olympe.D.Ma(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ga);olympe.dc.ia=function(){return olympe.dc.Ir().view};olympe.dc.register=function(a,b){olympe.dc.oa.C(a,b)};
859
- olympe.dc.defineProperty=function(a){return new olympe.dc.Na.Property(a)};olympe.dc.Br=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Na.Relation(a,b):new olympe.dc.Na.Relation(a,d,b,c)};olympe.dc.gw=function(a){return a.cc()};olympe.dc.nb={};olympe.dc.nb.Hm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Ab(a):a instanceof olympe.D.Oa?a:null;olympe.dc.nb.Em=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Xb(a):a instanceof olympe.D.fa?a:null;olympe.dc.nb.Gm=a=>'number'===typeof a||a instanceof Number?olympe.D.sa(a):'string'===typeof a||a instanceof String?olympe.D.sa(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ba?a:null;
860
- olympe.dc.nb.Fm=a=>'number'===typeof a||a instanceof Number?Wb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.ib(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.ib(a):a instanceof olympe.D.ib?a:null;olympe.dc.nb.wr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?$b(a.valueOf()):null};olympe.dc.nb.xr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.Fc?olympe.dc.CloudObject.get(a.tag):null;
861
- olympe.dc.nb.Qi=a=>a instanceof olympe.dc.Fc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.zc=a=>{a=a instanceof olympe.dc.Fc?olympe.dc.CloudObject.get(a.tag):a;let b;return null!=(b=a instanceof olympe.dc.CloudObject?a.zc():a)?b:null};
862
- olympe.dc.nb.Aw=a=>{switch(a){case olympe.D.fa:return olympe.dc.nb.Em;case olympe.D.Oa:return olympe.dc.nb.Hm;case olympe.D.ba:return olympe.dc.nb.Gm;case olympe.D.ib:return olympe.dc.nb.Fm;case olympe.D.Color:return olympe.dc.nb.wr;case olympe.dc.CloudObject:return olympe.dc.nb.xr;default:return olympe.dc.nb.Qi}};olympe.dc.kc={};olympe.dc.gf=class{na(){}G(){}compare(){}J(){}ha(){}toString(){}};function ql(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Nb();return b}function rl(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.V()} 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.ma.gb('dc').warn(a))}
863
- olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ma.gb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.va([a],olympe.dc.ga,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||ql(this),this.C=null,this.yc=void 0)}le(){return olympe.dc.le()}ob(){if(null===this.C){const a=olympe.dc.kc.Yw();this.C=sl(a,this,this.yc);null!==this.valueType&&this.C.Hd(this.valueType);olympe.D.$a().Z(()=>
864
- {var b=this.C.V();a.H.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}mc(){null===this.C&&this.ob();return this.C}Hd(a){this.valueType=a;null!==this.C&&this.C.Hd(this.valueType)}Nb(){return null!==this.C?this.C.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Ud(){return this.F}El(){return this.da}Bd(a,b){return this.mc().Bd(a,b)}Fk(a){this.mc().Fk(a)}Lt(){return this.mc().Tc()}Kt(){return this.mc().T()}get(a){return this.mc().get(a)}Rh(){return this.mc().Rh()}Ph(a){const b=
865
- this.mc();rl(b,'getCurrent');return b.Ph(a)}has(a){return this.mc().has(a)}Vg(a){const b=this.mc();rl(b,'hasCurrent');return b.Vg(a)}ie(a){return this.mc().ie(a)}ay(a){return this.ie(a).asObservable()}Ze(a){const b=this.mc();rl(b,'getCurrentAt');return b.Ze(a)}$e(a){return this.mc().$e(a)}Af(a){const b=this.mc();rl(b,'getCurrentKeyAt');return b.Af(a)}Wd(a){return this.mc().Wd(a)}iy(a){return this.Wd(a).asObservable()}Bf(a){const b=this.mc();rl(b,'getCurrentRank');return b.Bf(a)}Gc(){return this.mc().Gc()}by(){return this.Gc().asObservable()}Cf(){return this.mc().Cf()}lf(){return this.mc().lf()}jy(){return this.lf().asObservable()}bg(){const a=
866
- this.mc();rl(a,'getCurrentSize');return a.bg()}forEach(a,b){this.mc().forEach(a,b)}he(a){const b=this.mc();rl(b,'forEachCurrentValue');return b.he(a)}Si(a,b,c,d){a=new olympe.dc.da.oh(a,b);(new olympe.dc.za(this.F,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
867
- if(c instanceof olympe.dc.Na.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.za(this.F,a);b.yc=this.yc;b.Hd(ql(b)||this.valueType||Object);return b}Kk(a){return this.transform(new olympe.dc.da.uf(a))}filter(a){return this.transform(new olympe.dc.da.jf(a))}kk(){const a=new olympe.dc.Ej(this.F,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.yc&&(a.yc=this.yc);
868
- 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.D.Ma(this.F)+a+')'}Jt(){return this.mc().sg()}Oc(){return olympe.D.va([this.lf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ze(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Ab(b+']')},olympe.D.Oa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.Kk;
869
- olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.he;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.bg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.jy;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.by;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Bf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.iy;
870
- olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.Ze;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.ay;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Fk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.Bd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Ud;olympe.dc.za.ya=[olympe.D.ld];m=olympe.dc.za.prototype;m.le.L=olympe.D.K.C;m.ob.L=olympe.D.K.J();m.mc.L=new olympe.D.K(()=>olympe.dc.kc.Subscription,[]);m.Hd.L=new olympe.D.K(()=>{},[]);
871
- m.Ud.L=new olympe.D.K(()=>String,[]);m.El.L=new olympe.D.K(()=>Array,[]);m.Bd.L=new olympe.D.K(()=>String,[]);m.Fk.L=new olympe.D.K(()=>{},[]);m.Lt.L=olympe.D.K.O;m.Kt.L=olympe.D.K.C;m.get.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Rh.L=new olympe.D.K(()=>Array,[]);m.Ph.L=olympe.D.K.C;m.has.L=olympe.D.K.O;m.Vg.L=olympe.D.K.C;m.ie.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Ze.L=olympe.D.K.C;m.$e.L=new olympe.D.K(()=>String,[]);m.Af.L=olympe.D.K.C;m.Wd.L=olympe.D.K.G;
872
- m.Bf.L=olympe.D.K.C;m.Gc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[],'valueType');m.Cf.L=new olympe.D.K(()=>String,[]);m.lf.L=olympe.D.K.G;m.bg.L=olympe.D.K.C;m.forEach.L=new olympe.D.K(()=>{},[]);m.he.L=olympe.D.K.C;m.Si.L=new olympe.D.K(()=>{},[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Kk.L=new olympe.D.K(()=>olympe.dc.za,[]);m.filter.L=new olympe.D.K(()=>olympe.dc.za,[]);m.kk.L=new olympe.D.K(()=>olympe.dc.Ej,[]);m.toString.L=olympe.D.K.C;m.Jt.L=olympe.D.K.C;m.Oc.L=olympe.D.K.F;const tl={Qy:'append',ql:'filter_not',Ko:'filter_and',Lo:'filter_or'};function ul(a,b){a=vl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.An(a,b)).F}
873
- olympe.dc.Ej=class{constructor(a,b){this.C=vl(a);this.H=olympe.ma.gb('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Xa=[];this.yc=void 0}ri(){const a=new olympe.dc.za(this.C,this.da,this.valueType);'boolean'===typeof this.yc&&(a.yc=this.yc);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.Na.Property)throw new wl('transform','Properties cannot be used as transformer, unlike relations '+
874
- d);if(!d||'function'!==typeof d.C)throw new wl('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.da.push(d)}return this}Kk(a){this.da.push(new olympe.dc.da.uf(a));return this}Oy(a){this.da.push(new olympe.dc.da.uf(vl(a)));return this}Nt(a){this.valueType=a;return this}fb(a){this.da.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}uw(a){for(const b of a)this.da.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}tw(a,
875
- b,c){a=new olympe.dc.da.ze(a,a.Ja(),b,c);this.da.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}sw(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.Gj(b,c);this.da.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Mt(){this.fb(olympe.dc.CloudObject.instancesRel);return this}Xe(a){var b=this.Xa.pop();b===tl.ql&&(a=new olympe.dc.$.ce(a),b=this.Xa.pop());switch(b){case tl.Ko:b=this.da.pop().F;b instanceof
876
- olympe.dc.$.Fd?(b=b.$,b.push(a),a=new olympe.dc.$.Fd(...b)):a=new olympe.dc.$.Fd(b,a);b=this.Xa.pop();break;case tl.Lo:b=this.da.pop().F,b instanceof olympe.dc.$.xe?(b=b.$,b.push(a),a=new olympe.dc.$.xe(...b)):a=new olympe.dc.$.xe(b,a),b=this.Xa.pop()}b===tl.ql&&(a=new olympe.dc.$.ce(a),this.Xa.pop());this.da.push(new olympe.dc.da.jf(a));return this}ow(a,b,c){return this.Xe(new olympe.dc.$.te(ul(a,c),new olympe.dc.Za.Le(b)))}contains(a,b,c=!1,d){return this.Xe(new olympe.dc.$.hf(ul(a,d),new olympe.dc.Za.Le(b),
877
- c))}Rb(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.Xe(new olympe.dc.$.mi(b))}zk(a){return this.Xe(new olympe.dc.$.te(new olympe.dc.Za.Gi,new olympe.dc.Za.Le(vl(a))))}pw(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.pd().zk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().pd().zk(a[b])}return this}Cx(a,b){if(!(a instanceof
878
- 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.Xe(new olympe.dc.$.ji(c,d,b))}xk(a,b,c){a=ul(a,c);return this.Xe(new olympe.dc.$.Aj(a,new olympe.dc.Za.Le(b)))}gj(a,b,c){a=ul(a,c);return this.Xe(new olympe.dc.$.ck(a,new olympe.dc.Za.Le(b)))}Tx(a,b,c,d){a=ul(a,d);return this.Xe(new olympe.dc.$.rf(a,b,c))}filter(a){const b=new class extends olympe.dc.$.hg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};
879
- return this.Xe(b)}pd(){this.Xa.push(tl.ql);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Xa.push(tl.Ko);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Xa.push(tl.Lo);return this}Jk(a,b,c){a=vl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.X():d=new olympe.dc.tc.String(new olympe.dc.Za.Ei(a,c));break;case olympe.dm.Number.P.X():d=new olympe.dc.tc.Number(new olympe.dc.Za.wi(a,c));break;case olympe.dm.DateTime.P.X():d=
880
- new olympe.dc.tc.DateTime(new olympe.dc.Za.ci(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Gg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.tc.hg{G(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Gg(d,c));return this}kw(){this.da.push(new olympe.dc.da.di);return this}aj(a,b){this.da.push(new olympe.dc.da.oh(a,b));return this}};class wl extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
881
- function vl(a){return'string'===typeof a||a instanceof olympe.D.Oa?a:'function'===typeof a?olympe.dc.oa.ec(a):olympe.D.hb(a)?a.Dh===olympe.D.Oa?a:olympe.D.va([a],b=>olympe.D.Ab(olympe.dc.ga(b)),olympe.D.Oa):a.X()}m=olympe.dc.Ej.prototype;m.ri.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=olympe.D.K.J();m.Kk.L=olympe.D.K.J();m.Oy.L=olympe.D.K.J();m.Nt.L=olympe.D.K.J();m.fb.L=olympe.D.K.J();m.uw.L=olympe.D.K.J();m.tw.L=olympe.D.K.J();m.sw.L=olympe.D.K.J();m.Mt.L=olympe.D.K.J();m.Xe.L=olympe.D.K.J();
882
- m.ow.L=olympe.D.K.J();m.contains.L=olympe.D.K.J();m.Rb.L=olympe.D.K.J();m.zk.L=olympe.D.K.J();m.pw.L=olympe.D.K.J();m.Cx.L=olympe.D.K.J();m.xk.L=olympe.D.K.J();m.gj.L=olympe.D.K.J();m.Tx.L=olympe.D.K.J();m.filter.L=olympe.D.K.J();m.pd.L=olympe.D.K.J();m.and.L=olympe.D.K.J();m.or.L=olympe.D.K.J();m.Jk.L=olympe.D.K.J();m.sort.L=olympe.D.K.J();m.kw.L=olympe.D.K.J();m.aj.L=olympe.D.K.J();function sl(a,b,c){const d=b.Ud();var e=new olympe.dc.query.Iu;let f;f=d;olympe.D.hb(f)&&(f=e.add(d));b=(b=b.El())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.G(f,b,e);let g,h,k=null!=(h=null==(g=a.C.get(e))?void 0:g.C)?h:null;null===k&&(a.H.debug('QueryMGR: new',a.F?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.G));k.getContext().run(()=>a.process(k,c));return k}
883
- function xl(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.V(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting subscription');var c=new olympe.dc.lc.Zq(a.db,a.H),d=b.V();olympe.D.Nc([b.Ud()],e=>{const f=olympe.dc.ga(e);a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting with baseTag',f);b.Mh()||b.Ak();af(a.db,f,yl(a,b,c),d);olympe.D.$a().Z(()=>Ze(a.db,f,d));a.db.Ia(f.valueOf())||zl(c);b.T()||(zl(c),b.hc([]))})}}
884
- function Al(a,b,c,d,e){const f=[b.Ud()],g=l=>l instanceof olympe.dc.da.uf;let h;const k=(null!=(h=b.Tg())?h:[]).filter(g);for(const l of k){f.push(l.Ud());let n;k.push(...(null!=(n=l.Tg())?n:[]).filter(g))}ol(a.O,()=>{olympe.D.Nc(f,()=>{const l=b.Td(c);Bl(a,l,b.V(),d,e)})})}
885
- function Bl(a,b,c,d,e){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.D.$a(),g=new olympe.async.Oj(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Mh(a.J,h,f,olympe.dc.Qa.SELF,olympe.dc.pa.$c.Lf,{yc: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.V()} has encountered an error: ${p}`))))})});Rc(g,(h,k)=>d(k));g.start()}
886
- function yl(a,b,c){const d=new olympe.dc.lc.lj;let e=!1;const f=olympe.D.$a(),g=b.Tg(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.od()||f.eb()||(k?b.Vg(n)?a.H.warn('Adding the same index twice (should never happen) for sub #',b.V(),', index #',n,', tag #',l):(a.H.debug('ListProcessor: [ID:',b.V(),'] - Adding Instance',l,'to the subscription'),b.ad(n,l)):(a.H.debug('ListProcessor: [ID:',b.V(),'] - Removing Instance',l,'from the subscription'),b.yk(n)),e||(Cl(c,()=>{p.Yf();zl(c)}),f.run(()=>p.le().fg(b.hc.bind(b))),
887
- e=!0),Dl(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,l)=>{const n=b.V();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,El(p,k,l,n))}}
888
- olympe.dc.kc.ku=class{constructor(a,b,c,d,e,f){this.H=a;this.db=b;this.F=f||e;this.O=c;this.J=d;this.C=new Map;this.G=new olympe.D.Zb('Legacy ListDef processor')}process(a,b){const c=a.V();var d=this.C.get(c);d||(d=new olympe.dc.kc.ov(a),this.C.set(c,d));d.counter++;Fl(d)?this.H.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.H.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.yf(),b||this.F&&d===olympe.dc.Qa.SERVER||d===olympe.dc.Qa.SELF?(this.H.debug('QueryMGR: [ID:',c,
889
- '] - Local subscription, no need for coverage check, booting subscription '),xl(this,a)):Al(this,a,d,e=>{e?this.H.error(e):xl(this,a)},b))}};function Gl(a){return olympe.D.hb(a)?'Node#'+a.Da.V():String(a)}function Hl(a,b){return olympe.D.hb(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
890
- olympe.dc.query.Iu=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.hb(a)?'n'+a.Da.V():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Aa=class{na(){}C(){}F(){}ha(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.D.kj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Zb('context subscription '+b,e));this.id=b;this.Bc=c;this.da=d||null;this.G=this.O.run(()=>olympe.D.Yd(olympe.dc.kc.Subscription.C.INIT));this.Ub=!1;this.aa=this.bc=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Y.xb(e)}catch(f){e=olympe.Y.Mc()}return e}V(){return this.id}Ud(){return this.Bc}Tg(){return this.da}yf(){const b=
891
- olympe.dc.Xd(),c=olympe.D.Ma(this.Ud());let d;return olympe.dc.CloudObject.instancesRel.Ga(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Ee(c)}Mh(){const b=olympe.D.Ma(this.G);return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.Tq}Ak(){if(this.G.Da.eb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.bc;this.bc=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);Tb(this.G,olympe.D.Yd(olympe.dc.kc.Subscription.C.Tq))}Tc(){return olympe.D.va([this.G],
892
- ()=>{},olympe.D.fa)}T(){const b=this.G.Da.Eb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.vh}Bd(b,c){this.T()?b(this):(null===this.aa&&(this.aa=new Map),void 0===c&&(c=olympe.Y.Mc()),this.aa.set(c,olympe.D.$a().G(b)));return c||''}Fk(b){null!==this.aa&&b&&this.aa.delete(b)}Ib(){const b=olympe.dc.kc.Subscription.C.vh;if(!this.G.Da.eb()&&olympe.D.Ma(this.G)!==b&&(this.wf(),Tb(this.G,b),null!==this.aa)){for(const c of this.aa.values())c(this);this.aa=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}hc(b){if(!this.G.Da.eb()){for(let c=
893
- 0,d=b.length;c<d;c++)this.ym(b[c],c);if(this.T())this.wf();else{this.Ub=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Ib()}}}ad(b,c){if(!this.G.Da.eb()&&(this.jk(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Ub&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Ib()}}yk(b){this.G.Da.eb()||(this.xm(b),
894
- this.Ni(b,!this.T()))}sg(){return this.T()?super.sg():'Subscription is not ready!'}Td(b){const c=olympe.D.Ma(this.Ud());return olympe.dc.kc.Subscription.F(c,b,this.Tg())}static F(b,c,d){var e=olympe.dc.pa.from(b,c).ge();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Re){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.fb(h,!0))}else if(e instanceof olympe.dc.da.ze){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ag(h,!0,!0))}else if(e instanceof
895
- olympe.dc.da.uf)e=a.F(olympe.D.Ma(e.Ud()),c,e.Tg()),b.push(...e);else if(e instanceof olympe.dc.da.jf||e instanceof olympe.dc.da.Gg){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.ag(n,!0,!0):k.fb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.C={INIT:0,Tq:1,vh:2};olympe.dc.kc.Subscription.prototype.sg.L=olympe.D.K.C;function Fl(a){const b=a.F;a.F=!0;return b}olympe.dc.kc.ov=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.tf=class{na(){}Nb(){}C(){}ha(){}toString(){}};olympe.dc.nq=class{G(){}};olympe.dc.hk=class{na(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.tc={};let Il=0;olympe.dc.tc.hg=class{constructor(){this.id=Il++}na(){return'CustomLocalComparator#'+Il}J(){return[]}G(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.tc.hg.ya=[olympe.dc.gf];olympe.dc.tc.DateTime=class{constructor(a){this.C=a}na(){return S(olympe.dc.tc.DateTime)}J(){return this.C.C()}G(a,b){return this.C.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}ha(a){return'{"c":"'+this.na()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};R('olympe.dc.comparators.DateTime',olympe.dc.tc.DateTime);olympe.dc.tc.DateTime.ya=[olympe.dc.gf];olympe.dc.tc.Number=class{constructor(a){this.C=a}na(){return S(olympe.dc.tc.Number)}J(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.na()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};R('olympe.dc.comparators.Number',olympe.dc.tc.Number);olympe.dc.tc.Number.ya=[olympe.dc.gf];olympe.dc.tc.String=class{constructor(a){this.C=a}na(){return S(olympe.dc.tc.String)}J(){return this.C.C()}G(a,b){return olympe.D.va([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Oa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.na()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};R('olympe.dc.comparators.String',olympe.dc.tc.String);olympe.dc.tc.String.ya=[olympe.dc.gf];olympe.dc.$={};let Jl=0;olympe.dc.$.hg=class{constructor(){this.id=Jl++}na(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.$.hg.ya=[olympe.dc.Aa];olympe.dc.$.Pk=class{constructor(a,b){this.G=a;this.J=b}na(){}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Xb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.fa))}O(){}ha(a){return'{"c":"'+this.na()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return this.na().replace(/^.+\./,'')+'('+this.G.toString()+','+this.J.toString()+')'}};
856
+ if(!this.F)throw Error('OperationError: Cannot create relation, destination tag is undefined, null or empty string');this.relation.Ja()===olympe.dc.wa.DESTINATION?a.Ha(b,olympe.dc.ga(this.origin),olympe.dc.ga(this.F)):a.Ha(b,olympe.dc.ga(this.F),olympe.dc.ga(this.origin))}toString(){return`CreateRelation('${this.relation.Ja()}${this.relation.X()}, ${olympe.dc.ga(this.origin)}, ${olympe.dc.ga(this.F)})`}};olympe.dc.transaction.Xa.Az=class extends olympe.dc.transaction.Xa.ig{constructor(a,b=olympe.dc.Ob.Dc){super();this.model=a instanceof olympe.dc.CloudObject?a:olympe.dc.CloudObject.get(a);this.Pb=b}C(a){for(const b of this.ia.bd(this.model))b!==olympe.dc.ga(this.model)&&(new olympe.dc.transaction.Xa.yo(b,this.Pb)).C(a)}toString(){return`DeleteAllInstances(${this.model.X()}, ${this.Pb})`}};olympe.dc.transaction.Xa.xo=class extends olympe.dc.transaction.Xa.zn{C(a){const b=this.getType();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(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.wa.DESTINATION?
857
+ a.jc(b,c,f):a.jc(b,f,c)}toString(){return`DeleteAllRelations(${this.Ja()}${this.getType()})`}};olympe.dc.transaction.Xa.yo=class extends olympe.dc.transaction.Xa.ig{constructor(a,b=olympe.dc.Ob.Dc){super();this.tag=this.ia.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Pb=b}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot delete instance, tag is undefined');this.ia.Ia(b)&&Zk(a,b,this.Pb)}toString(){return'DeleteInstance('+this.X()+', '+this.Pb+')'}};olympe.dc.transaction.Xa.bt=class extends olympe.dc.transaction.Xa.gl{C(a){const b=this.relation.X();if(void 0===b)throw Error('OperationError: Cannot delete relation, type is undefined');if(b===olympe.dc.nc.Zc)throw Error('OperationError: Cannot delete the instance -> model relation');const c=olympe.dc.ga(this.origin);if(void 0===c)throw Error('OperationError: Cannot delete relation, left tag is undefined');const d=olympe.dc.ga(this.F);if(void 0===d)throw Error('OperationError: Cannot delete relation, right tag is undefined');
858
+ this.relation.Ja()===olympe.dc.wa.DESTINATION?a.jc(b,c,d):a.jc(b,d,c)}toString(){return'DeleteRelation('+this.relation.Ja()+this.relation.X()+', '+olympe.dc.ga(this.origin)+', '+olympe.dc.ga(this.F)+')'}};olympe.dc.transaction.Xa.Iv=class extends olympe.dc.transaction.Xa.ig{constructor(a,b,c){super();this.tag=this.ia.Ia(a)?olympe.dc.CloudObject.get(a):a;this.Dd=new Map;void 0!==b&&this.Dd.set(olympe.dc.ga(b),c)}X(){return olympe.dc.ga(this.tag)}C(a){const b=this.X();if(void 0===b)throw Error('OperationError: Cannot update instance, tag is undefined');var c;if(!(null!=(c=a.C.Mc(b))&&c.F()||this.ia.Ia(b)))throw Error('OperationError: Instance #'+b+' not found so it cannot be updated');c=ql(this,this.Dd);
859
+ for(const [e,f]of c){var d=this.ia.Ra(b,e,!0);d instanceof olympe.dc.vc&&Zk(a,d.X(),olympe.dc.Ob.Dc);f instanceof olympe.dc.vc&&!Vk(a,f.X())&&(d=new olympe.dc.Wa,d.persist(f.X()),d.C(a))}a.Rc(b,c)}toString(){return'UpdateInstance('+this.X()+', '+ql(this,this.Dd)+')'}};olympe.dc.transaction.Xa.Mu=class a extends olympe.dc.transaction.Xa.ig{constructor(b,c){super();this.tag=b;this.source=c}C(b){const c=olympe.dc.ia();if(Vk(b,this.tag)&&c.Ia(this.tag)&&!c.Hf(this.tag)){const e=c.Cb(this.tag,!0);var d;let f;null==(f=null==(d=b.C.Mc(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.Ia(g.X())&&(new a(g.X(),this.source)).C(b);d=c.model(this.tag);b.Vc(this.tag,d,this.source,e);for(const [g,h,k]of Ig(c,this.tag))Vk(b,
860
+ k)&&(h===olympe.dc.wa.ORIGIN?b.Ha(g,k,this.tag):b.Ha(g,this.tag,k))}}toString(){return`PersistOperation: tag - ${this.tag}, src - ${this.source}`}};olympe.dc.ga=function(a){let b=null;if('string'===typeof a)return a;if('function'===typeof(null==a?void 0:a.X)&&(null==a||!a.Kg))b=a.X();else if('function'===typeof a){let d;b=null!=(d=olympe.dc.oa.ec(a))?d:''}else if(olympe.D.bf(a)){let d;b=olympe.dc.ga(null==(d=olympe.D.Ma(a))?void 0:d.valueOf())}let c;return null!=(c=b)?c:''};w('olympe.dc.instanceToTag',olympe.dc.ga);olympe.dc.ia=function(){return olympe.dc.Jr().view};olympe.dc.register=function(a,b){olympe.dc.oa.C(a,b)};
861
+ olympe.dc.defineProperty=function(a){return new olympe.dc.Na.Property(a)};olympe.dc.Cr=function(a,b=olympe.dc.wa.DESTINATION,c=olympe.dc.CloudObject,d=olympe.dc.wa.DESTINATION){const e=olympe.dc.wa.DESTINATION;return b===olympe.dc.wa.ORIGIN||b===e?new olympe.dc.Na.Relation(a,b):new olympe.dc.Na.Relation(a,d,b,c)};olympe.dc.hw=function(a){return a.cc()};olympe.dc.nb={};olympe.dc.nb.Hm=a=>'string'===typeof a||'number'===typeof a||'boolean'===typeof a||a instanceof String?olympe.D.Ab(a):a instanceof olympe.D.Oa?a:null;olympe.dc.nb.Em=a=>'boolean'===typeof a||a instanceof Boolean?olympe.D.Xb(a):a instanceof olympe.D.fa?a:null;olympe.dc.nb.Gm=a=>'number'===typeof a||a instanceof Number?olympe.D.sa(a):'string'===typeof a||a instanceof String?olympe.D.sa(Number.parseFloat(a.valueOf())):a instanceof olympe.D.ba?a:null;
862
+ olympe.dc.nb.Fm=a=>'number'===typeof a||a instanceof Number?Wb(a.valueOf()):'string'===typeof a||a instanceof String?new olympe.D.fb(new Date(a.valueOf().valueOf())):a instanceof Date?new olympe.D.fb(a):a instanceof olympe.D.fb?a:null;olympe.dc.nb.xr=function(a){return a instanceof olympe.D.Color?a:'string'===typeof a||a instanceof String?$b(a.valueOf()):null};olympe.dc.nb.yr=a=>a instanceof olympe.dc.CloudObject?a:a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):null;
863
+ olympe.dc.nb.Qi=a=>a instanceof olympe.dc.vc?olympe.dc.CloudObject.get(a.tag):a;olympe.dc.nb.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};
864
+ olympe.dc.nb.Bw=a=>{switch(a){case olympe.D.fa:return olympe.dc.nb.Em;case olympe.D.Oa:return olympe.dc.nb.Hm;case olympe.D.ba:return olympe.dc.nb.Gm;case olympe.D.fb:return olympe.dc.nb.Fm;case olympe.D.Color:return olympe.dc.nb.xr;case olympe.dc.CloudObject:return olympe.dc.nb.yr;default:return olympe.dc.nb.Qi}};olympe.dc.kc={};olympe.dc.gf=class{na(){}G(){}compare(){}K(){}ha(){}toString(){}};function rl(a){let b=null;for(a=[...a.da];null===b&&0<a.length;)b=a.pop().Nb();return b}function sl(a,b){a.T()||(a=`Calling "${b}" on subscription with id ${a.V()} 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.ma.hb('dc').warn(a))}
865
+ olympe.dc.za=class{constructor(a,b,c){void 0===a||null===a?olympe.ma.hb('dc').warn('attempt to create a listdef with a null or undefind basetag. This listdef is thus without effect.'):(this.F=olympe.D.va([a],olympe.dc.ga,String),this.da=void 0!==b&&(Array.isArray(b)?b:[b])||[],this.valueType=c||rl(this),this.C=null,this.zc=void 0)}ke(){return olympe.dc.ke()}ob(){if(null===this.C){const a=olympe.dc.kc.Zw();this.C=tl(a,this,this.zc);null!==this.valueType&&this.C.Hd(this.valueType);olympe.D.$a().Z(()=>
866
+ {var b=this.C.V();a.H.debug('QueryMGR: [ID:',b,'] - Unregistered');const c=a.C.get(b);if(null==c)var d=0;else 0<c.counter&&c.counter--,d=0===c.counter;d&&(c.C.release(),a.C.delete(b));this.C=null})}return this}mc(){null===this.C&&this.ob();return this.C}Hd(a){this.valueType=a;null!==this.C&&this.C.Hd(this.valueType)}Nb(){return null!==this.C?this.C.Nb():null===this.valueType?olympe.dc.CloudObject:this.valueType}Ud(){return this.F}El(){return this.da}Bd(a,b){return this.mc().Bd(a,b)}Fk(a){this.mc().Fk(a)}Mt(){return this.mc().Uc()}Lt(){return this.mc().T()}get(a){return this.mc().get(a)}Sh(){return this.mc().Sh()}Qh(a){const b=
867
+ this.mc();sl(b,'getCurrent');return b.Qh(a)}has(a){return this.mc().has(a)}Vg(a){const b=this.mc();sl(b,'hasCurrent');return b.Vg(a)}he(a){return this.mc().he(a)}by(a){return this.he(a).asObservable()}Ze(a){const b=this.mc();sl(b,'getCurrentAt');return b.Ze(a)}$e(a){return this.mc().$e(a)}Bf(a){const b=this.mc();sl(b,'getCurrentKeyAt');return b.Bf(a)}Wd(a){return this.mc().Wd(a)}jy(a){return this.Wd(a).asObservable()}Cf(a){const b=this.mc();sl(b,'getCurrentRank');return b.Cf(a)}Gc(){return this.mc().Gc()}ey(){return this.Gc().asObservable()}Df(){return this.mc().Df()}lf(){return this.mc().lf()}ky(){return this.lf().asObservable()}bg(){const a=
868
+ this.mc();sl(a,'getCurrentSize');return a.bg()}forEach(a,b){this.mc().forEach(a,b)}ge(a){const b=this.mc();sl(b,'forEachCurrentValue');return b.ge(a)}Si(a,b,c,d){a=new olympe.dc.da.oh(a,b);(new olympe.dc.za(this.F,[...this.da,a],this.valueType)).forEach(c,d)}transform(...a){var b=a;if(Array.isArray(a[0])){if(1<a.length)throw Error('ListDef.transform() should be called either with one array argument, or with ... arguments, but not both');b=a[0]}a=[...this.da];for(const c of b){if(void 0===c)throw Error('ListDef.transform(): Trying to set an undefined transformer');
869
+ if(c instanceof olympe.dc.Na.Property)throw Error(`ListDef.transform(): Properties cannot be used as transformer, unlike relations ${c}`);if(!c||'function'!==typeof c.C)break;a.push(c)}b=new olympe.dc.za(this.F,a);b.zc=this.zc;b.Hd(rl(b)||this.valueType||Object);return b}Kk(a){return this.transform(new olympe.dc.da.vf(a))}filter(a){return this.transform(new olympe.dc.da.jf(a))}kk(){const a=new olympe.dc.Ej(this.F,null===this.valueType?void 0:this.valueType);'boolean'===typeof this.zc&&(a.zc=this.zc);
870
+ 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.D.Ma(this.F)+a+')'}Kt(){return this.mc().sg()}Pc(){return olympe.D.va([this.lf()],a=>{let b='[';for(let c=0;c<a;c++){const d=this.Ze(c).toString();b=0<c&&c<a?b+(', '+d):b+d}return olympe.D.Ab(b+']')},olympe.D.Oa)}};olympe.dc.za.prototype.filter=olympe.dc.za.prototype.filter;olympe.dc.za.prototype.union=olympe.dc.za.prototype.Kk;
871
+ olympe.dc.za.prototype.transform=olympe.dc.za.prototype.transform;olympe.dc.za.prototype.forEachCurrentValue=olympe.dc.za.prototype.ge;olympe.dc.za.prototype.forEach=olympe.dc.za.prototype.forEach;olympe.dc.za.prototype.getCurrentSize=olympe.dc.za.prototype.bg;olympe.dc.za.prototype.observeSize=olympe.dc.za.prototype.ky;olympe.dc.za.prototype.observeFirst=olympe.dc.za.prototype.ey;olympe.dc.za.prototype.getCurrentRank=olympe.dc.za.prototype.Cf;olympe.dc.za.prototype.observeRank=olympe.dc.za.prototype.jy;
872
+ olympe.dc.za.prototype.getCurrentAt=olympe.dc.za.prototype.Ze;olympe.dc.za.prototype.observeAt=olympe.dc.za.prototype.by;olympe.dc.za.prototype.offReady=olympe.dc.za.prototype.Fk;olympe.dc.za.prototype.onReady=olympe.dc.za.prototype.Bd;olympe.dc.za.prototype.getBaseTag=olympe.dc.za.prototype.Ud;olympe.dc.za.ya=[olympe.D.ld];m=olympe.dc.za.prototype;m.ke.L=olympe.D.J.C;m.ob.L=olympe.D.J.K();m.mc.L=new olympe.D.J(()=>olympe.dc.kc.Subscription,[]);m.Hd.L=new olympe.D.J(()=>{},[]);
873
+ m.Ud.L=new olympe.D.J(()=>String,[]);m.El.L=new olympe.D.J(()=>Array,[]);m.Bd.L=new olympe.D.J(()=>String,[]);m.Fk.L=new olympe.D.J(()=>{},[]);m.Mt.L=olympe.D.J.O;m.Lt.L=olympe.D.J.C;m.get.L=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Sh.L=new olympe.D.J(()=>Array,[]);m.Qh.L=olympe.D.J.C;m.has.L=olympe.D.J.O;m.Vg.L=olympe.D.J.C;m.he.L=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Ze.L=olympe.D.J.C;m.$e.L=new olympe.D.J(()=>String,[]);m.Bf.L=olympe.D.J.C;m.Wd.L=olympe.D.J.G;
874
+ m.Cf.L=olympe.D.J.C;m.Gc.L=new olympe.D.J(()=>olympe.dc.CloudObject,[],'valueType');m.Df.L=new olympe.D.J(()=>String,[]);m.lf.L=olympe.D.J.G;m.bg.L=olympe.D.J.C;m.forEach.L=new olympe.D.J(()=>{},[]);m.ge.L=olympe.D.J.C;m.Si.L=new olympe.D.J(()=>{},[]);m.transform.L=new olympe.D.J(()=>olympe.dc.za,[]);m.Kk.L=new olympe.D.J(()=>olympe.dc.za,[]);m.filter.L=new olympe.D.J(()=>olympe.dc.za,[]);m.kk.L=new olympe.D.J(()=>olympe.dc.Ej,[]);m.toString.L=olympe.D.J.C;m.Kt.L=olympe.D.J.C;m.Pc.L=olympe.D.J.F;const ul={Ry:'append',ql:'filter_not',Ko:'filter_and',Lo:'filter_or'};function vl(a,b){a=wl(a);a=olympe.dc.CloudObject.get(a);return(new olympe.dc.Za.An(a,b)).F}
875
+ olympe.dc.Ej=class{constructor(a,b){this.C=wl(a);this.H=olympe.ma.hb('dc.query');this.valueType=void 0===b?olympe.dc.CloudObject:b;this.da=[];this.Xa=[];this.zc=void 0}si(){const a=new olympe.dc.za(this.C,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 xl('transform','Trying to set an undefined transformer');if(d instanceof olympe.dc.Na.Property)throw new xl('transform','Properties cannot be used as transformer, unlike relations '+
876
+ d);if(!d||'function'!==typeof d.C)throw new xl('transform','one of the argument is not a Transformer '+d);const e=d.Nb();null!==e&&(this.valueType=e);this.da.push(d)}return this}Kk(a){this.da.push(new olympe.dc.da.vf(a));return this}Py(a){this.da.push(new olympe.dc.da.vf(wl(a)));return this}Ot(a){this.valueType=a;return this}gb(a){this.da.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}vw(a){for(const b of a)this.da.push(b),this.valueType=b.Nb()||olympe.dc.CloudObject;return this}uw(a,
877
+ b,c){a=new olympe.dc.da.ye(a,a.Ja(),b,c);this.da.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}tw(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.Gj(b,c);this.da.push(a);this.valueType=a.Nb()||olympe.dc.CloudObject;return this}Nt(){this.gb(olympe.dc.CloudObject.instancesRel);return this}Xe(a){var b=this.Xa.pop();b===ul.ql&&(a=new olympe.dc.$.ce(a),b=this.Xa.pop());switch(b){case ul.Ko:b=this.da.pop().F;b instanceof
878
+ olympe.dc.$.Fd?(b=b.$,b.push(a),a=new olympe.dc.$.Fd(...b)):a=new olympe.dc.$.Fd(b,a);b=this.Xa.pop();break;case ul.Lo:b=this.da.pop().F,b instanceof olympe.dc.$.we?(b=b.$,b.push(a),a=new olympe.dc.$.we(...b)):a=new olympe.dc.$.we(b,a),b=this.Xa.pop()}b===ul.ql&&(a=new olympe.dc.$.ce(a),this.Xa.pop());this.da.push(new olympe.dc.da.jf(a));return this}pw(a,b,c){return this.Xe(new olympe.dc.$.se(vl(a,c),new olympe.dc.Za.Le(b)))}contains(a,b,c=!1,d){return this.Xe(new olympe.dc.$.hf(vl(a,d),new olympe.dc.Za.Le(b),
879
+ c))}Sb(a){if(!(a instanceof Array))throw new xl('instanceOf','Provided argument "models" must be an array.');const b=[];for(let c=0;c<a.length;c++)b.push(wl(a[c]));return this.Xe(new olympe.dc.$.ni(b))}zk(a){return this.Xe(new olympe.dc.$.se(new olympe.dc.Za.Gi,new olympe.dc.Za.Le(wl(a))))}qw(a){if(!Array.isArray(a))throw Error('ExcludeInstances should be called with an array');if(0<a.length){this.pd().zk(a[0]);for(let b=1,c=a.length;b<c;b++)this.and().pd().zk(a[b])}return this}Dx(a,b){if(!(a instanceof
880
+ Array))throw new xl('hasRelated','Provided argument "relations" must be an array.');const c=[],d=[];a.forEach(e=>{c.push(e);d.push(e.Ja())});return this.Xe(new olympe.dc.$.ki(c,d,b))}xk(a,b,c){a=vl(a,c);return this.Xe(new olympe.dc.$.Aj(a,new olympe.dc.Za.Le(b)))}gj(a,b,c){a=vl(a,c);return this.Xe(new olympe.dc.$.ck(a,new olympe.dc.Za.Le(b)))}Ux(a,b,c,d){a=vl(a,d);return this.Xe(new olympe.dc.$.sf(a,b,c))}filter(a){const b=new class extends olympe.dc.$.hg{C(c,d){return a(olympe.dc.CloudObject.get(d))}};
881
+ return this.Xe(b)}pd(){this.Xa.push(ul.ql);return this}and(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Xa.push(ul.Ko);return this}or(){this.da[this.da.length-1]instanceof olympe.dc.da.jf&&this.Xa.push(ul.Lo);return this}Jk(a,b,c){a=wl(a);let d=null;switch(olympe.dc.ia().Jb(a,olympe.dm.Property.typeRel)){case olympe.dm.String.P.X():d=new olympe.dc.wc.String(new olympe.dc.Za.Ei(a,c));break;case olympe.dm.Number.P.X():d=new olympe.dc.wc.Number(new olympe.dc.Za.xi(a,c));break;case olympe.dm.DateTime.P.X():d=
882
+ new olympe.dc.wc.DateTime(new olympe.dc.Za.di(a,c))}c=d;null!==c&&this.da.push(new olympe.dc.da.Gg(c,b));return this}sort(a,b,c){const d=new class extends olympe.dc.wc.hg{G(e,f){return a(olympe.dc.CloudObject.get(f))}compare(e,f){return b(e,f).valueOf()}};this.da.push(new olympe.dc.da.Gg(d,c));return this}lw(){this.da.push(new olympe.dc.da.ei);return this}aj(a,b){this.da.push(new olympe.dc.da.oh(a,b));return this}};class xl extends Error{constructor(a,b){super(`ListDefBuilder.${a}(): ${b}`)}}
883
+ function wl(a){return'string'===typeof a||a instanceof olympe.D.Oa?a:'function'===typeof a?olympe.dc.oa.ec(a):olympe.D.ib(a)?a.Eh===olympe.D.Oa?a:olympe.D.va([a],b=>olympe.D.Ab(olympe.dc.ga(b)),olympe.D.Oa):a.X()}m=olympe.dc.Ej.prototype;m.si.L=new olympe.D.J(()=>olympe.dc.za,[]);m.transform.L=olympe.D.J.K();m.Kk.L=olympe.D.J.K();m.Py.L=olympe.D.J.K();m.Ot.L=olympe.D.J.K();m.gb.L=olympe.D.J.K();m.vw.L=olympe.D.J.K();m.uw.L=olympe.D.J.K();m.tw.L=olympe.D.J.K();m.Nt.L=olympe.D.J.K();m.Xe.L=olympe.D.J.K();
884
+ m.pw.L=olympe.D.J.K();m.contains.L=olympe.D.J.K();m.Sb.L=olympe.D.J.K();m.zk.L=olympe.D.J.K();m.qw.L=olympe.D.J.K();m.Dx.L=olympe.D.J.K();m.xk.L=olympe.D.J.K();m.gj.L=olympe.D.J.K();m.Ux.L=olympe.D.J.K();m.filter.L=olympe.D.J.K();m.pd.L=olympe.D.J.K();m.and.L=olympe.D.J.K();m.or.L=olympe.D.J.K();m.Jk.L=olympe.D.J.K();m.sort.L=olympe.D.J.K();m.lw.L=olympe.D.J.K();m.aj.L=olympe.D.J.K();function tl(a,b,c){const d=b.Ud();var e=new olympe.dc.query.Ju;let f;f=d;olympe.D.ib(f)&&(f=e.add(d));b=(b=b.El())?Array.isArray(b)?b:[b]:null;e=olympe.dc.kc.Subscription.G(f,b,e);let g,h,k=null!=(h=null==(g=a.C.get(e))?void 0:g.C)?h:null;null===k&&(a.H.debug('QueryMGR: new',a.F?'local':'remote','subscription "',e,'": #',`${f},`,b),k=new olympe.dc.kc.Subscription(e,d,b,a.G));k.getContext().run(()=>a.process(k,c));return k}
885
+ function yl(a,b){if(b.T())a.H.debug('ListProcessor: [ID:',b.V(),'] - Subscription already booted, ignoring');else{a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting subscription');var c=new olympe.dc.lc.$q(a.db,a.H),d=b.V();olympe.D.Oc([b.Ud()],e=>{const f=olympe.dc.ga(e);a.H.debug('ListProcessor: [ID:',b.V(),'] - Booting with baseTag',f);b.Nh()||b.Ak();af(a.db,f,zl(a,b,c),d);olympe.D.$a().Z(()=>Ze(a.db,f,d));a.db.Ia(f.valueOf())||Al(c);b.T()||(Al(c),b.hc([]))})}}
886
+ function Bl(a,b,c,d,e){const f=[b.Ud()],g=l=>l instanceof olympe.dc.da.vf;let h;const k=(null!=(h=b.Tg())?h:[]).filter(g);for(const l of k){f.push(l.Ud());let n;k.push(...(null!=(n=l.Tg())?n:[]).filter(g))}pl(a.O,()=>{olympe.D.Oc(f,()=>{const l=b.Td(c);Cl(a,l,b.V(),d,e)})})}
887
+ function Cl(a,b,c,d,e){a.H.debug('CoverageProcessor: [ID:',c,'] - checking coverage of remote query over',b.length,'paths.');const f=olympe.D.$a(),g=new olympe.async.Oj(f);b.forEach(h=>{g.add((k,l)=>{let n=!1;Mh(a.K,h,f,olympe.dc.Qa.SELF,olympe.dc.pa.$c.Mf,{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.V()} has encountered an error: ${p}`))))})});Rc(g,(h,k)=>d(k));g.start()}
888
+ function zl(a,b,c){const d=new olympe.dc.lc.lj;let e=!1;const f=olympe.D.$a(),g=b.Tg(),h=[];h[g?g.length:0]=(k,l,n,p)=>{f.od()||f.eb()||(k?b.Vg(n)?a.H.warn('Adding the same index twice (should never happen) for sub #',b.V(),', index #',n,', tag #',l):(a.H.debug('ListProcessor: [ID:',b.V(),'] - Adding Instance',l,'to the subscription'),b.ad(n,l)):(a.H.debug('ListProcessor: [ID:',b.V(),'] - Removing Instance',l,'from the subscription'),b.yk(n)),e||(Dl(c,()=>{p.Yf();Al(c)}),f.run(()=>p.ke().fg(b.hc.bind(b))),
889
+ e=!0),El(c,n))};if(null!==g)for(let k=g.length-1;0<=k;k--)h[k]=g[k].C(f,c,h[k+1]);return(k,l)=>{const n=b.V();c.register(n,null);const p=d.C(k,l,n,null);if(null!==p)h[0](k,l,n,Fl(p,k,l,n))}}
890
+ olympe.dc.kc.lu=class{constructor(a,b,c,d,e,f){this.H=a;this.db=b;this.F=f||e;this.O=c;this.K=d;this.C=new Map;this.G=new olympe.D.Zb('Legacy ListDef processor')}process(a,b){const c=a.V();var d=this.C.get(c);d||(d=new olympe.dc.kc.pv(a),this.C.set(c,d));d.counter++;Gl(d)?this.H.debug('ListProcessor: [ID:',c,'] - id already processed'):(this.H.debug('ListProcessor: [ID:',c,'] - NOT processed yet.'),d=a.zf(),b||this.F&&d===olympe.dc.Qa.SERVER||d===olympe.dc.Qa.SELF?(this.H.debug('QueryMGR: [ID:',c,
891
+ '] - Local subscription, no need for coverage check, booting subscription '),yl(this,a)):Bl(this,a,d,e=>{e?this.H.error(e):yl(this,a)},b))}};function Hl(a){return olympe.D.ib(a)?'Node#'+a.Da.V():String(a)}function Il(a,b){return olympe.D.ib(b)?'{"c":"Parameter","v":"'+a.add(b)+'"}':JSON.stringify(b)}
892
+ olympe.dc.query.Ju=class{constructor(){this.C=0;this.values=null}add(a){let b;b=olympe.D.ib(a)?'n'+a.Da.V():'p'+ ++this.C;null===this.values&&(this.values={});this.values[b]=a;return b}get(a){return this.values[a]}clear(){const a=this.values;if(null!==a)for(let b=Object.keys(a),c=b.length,d=0;d<c;d++)delete a[b[d]]}forEach(a){const b=this.values;if(null!==b)for(let c=Object.keys(b),d=c.length,e=0;e<d;e++)a(b[c[e]],c[e])}};olympe.dc.Aa=class{na(){}C(){}F(){}ha(){}toString(){}};olympe.dc.kc.Subscription=class a extends olympe.D.kj{constructor(b,c,d,e){super(olympe.dc.CloudObject,new olympe.D.Zb('context subscription '+b,e));this.id=b;this.Cc=c;this.da=d||null;this.G=this.O.run(()=>olympe.D.Yd(olympe.dc.kc.Subscription.C.INIT));this.Vb=!1;this.aa=this.bc=null}static G(b,c,d){let e;try{e=b;if(c)for(let f=0,g=c.length;f<g;f++)e+='|'+c[f].ha(d);else e+='|null';e=olympe.Y.xb(e)}catch(f){e=olympe.Y.Nc()}return e}V(){return this.id}Ud(){return this.Cc}Tg(){return this.da}zf(){const b=
893
+ olympe.dc.Xd(),c=olympe.D.Ma(this.Ud());let d;return olympe.dc.CloudObject.instancesRel.Ga(null==(d=this.da)?void 0:d[0])?b.fromModel(c):b.Ee(c)}Nh(){const b=olympe.D.Ma(this.G);return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.Uq}Ak(){if(this.G.Da.eb())throw Error(`Cannot set destroyed subscription '${this.id}' as subscribed`);const b=this.bc;this.bc=null;for(let c in b)if(Object.prototype.hasOwnProperty.call(b,c))b[c](this);Tb(this.G,olympe.D.Yd(olympe.dc.kc.Subscription.C.Uq))}Uc(){return olympe.D.va([this.G],
894
+ ()=>{},olympe.D.fa)}T(){const b=this.G.Da.Eb;return b&&b.valueOf()>=olympe.dc.kc.Subscription.C.wh}Bd(b,c){this.T()?b(this):(null===this.aa&&(this.aa=new Map),void 0===c&&(c=olympe.Y.Nc()),this.aa.set(c,olympe.D.$a().G(b)));return c||''}Fk(b){null!==this.aa&&b&&this.aa.delete(b)}Ib(){const b=olympe.dc.kc.Subscription.C.wh;if(!this.G.Da.eb()&&olympe.D.Ma(this.G)!==b&&(this.xf(),Tb(this.G,b),null!==this.aa)){for(const c of this.aa.values())c(this);this.aa=null}}onDestroy(b){this.O.onDestroy(b)}release(){this.O.destroy()}hc(b){if(!this.G.Da.eb()){for(let c=
895
+ 0,d=b.length;c<d;c++)this.ym(b[c],c);if(this.T())this.xf();else{this.Vb=b=!0;for(let c in this.F)if(Object.prototype.hasOwnProperty.call(this.F,c)&&!Object.prototype.hasOwnProperty.call(this.values,c)){b=!1;break}b&&this.Ib()}}}ad(b,c){if(!this.G.Da.eb()&&(this.jk(b,olympe.dc.CloudObject.get(c)),b=this.T(),this.Vb&&!b)){b=!0;for(let d in this.F)if(Object.prototype.hasOwnProperty.call(this.F,d)&&!Object.prototype.hasOwnProperty.call(this.values,d)){b=!1;break}b&&this.Ib()}}yk(b){this.G.Da.eb()||(this.xm(b),
896
+ this.Ni(b,!this.T()))}sg(){return this.T()?super.sg():'Subscription is not ready!'}Td(b){const c=olympe.D.Ma(this.Ud());return olympe.dc.kc.Subscription.F(c,b,this.Tg())}static F(b,c,d){var e=olympe.dc.pa.from(b,c).fe();if(null===d)return[e];b=[];b.push(e);for(let f=0,g=d.length;f<g;f++)if(e=d[f],e instanceof olympe.dc.da.Re){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.gb(h,!0))}else if(e instanceof olympe.dc.da.ye){const h=olympe.dc.query.Relation.from(e);b=b.map(k=>k.ag(h,!0,!0))}else if(e instanceof
897
+ olympe.dc.da.vf)e=a.F(olympe.D.Ma(e.Ud()),c,e.Tg()),b.push(...e);else if(e instanceof olympe.dc.da.jf||e instanceof olympe.dc.da.Gg){const h=e.G();b=b.map(k=>{for(const l of h){for(const n of l)k=n.recursive?k.ag(n,!0,!0):k.gb(n,!0);k=k.back(l.length)}return k})}return b}};olympe.dc.kc.Subscription.C={INIT:0,Uq:1,wh:2};olympe.dc.kc.Subscription.prototype.sg.L=olympe.D.J.C;function Gl(a){const b=a.F;a.F=!0;return b}olympe.dc.kc.pv=class{constructor(a){this.counter=0;this.F=!1;this.C=a}};olympe.dc.uf=class{na(){}Nb(){}C(){}ha(){}toString(){}};olympe.dc.oq=class{G(){}};olympe.dc.hk=class{na(){}getValue(){}C(){}ha(){}toString(){}};olympe.dc.wc={};let Jl=0;olympe.dc.wc.hg=class{constructor(){this.id=Jl++}na(){return'CustomLocalComparator#'+Jl}K(){return[]}G(){throw Error('GetComparedValue function was not implemented.');}compare(){throw Error('Compare function was not implemented.');}ha(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.wc.hg.ya=[olympe.dc.gf];olympe.dc.wc.DateTime=class{constructor(a){this.C=a}na(){return S(olympe.dc.wc.DateTime)}K(){return this.C.C()}G(a,b){return this.C.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}ha(a){return'{"c":"'+this.na()+'",a:['+this.C.ha(a)+']}'}toString(){return'Number('+this.C.toString()+')'}};R('olympe.dc.comparators.DateTime',olympe.dc.wc.DateTime);olympe.dc.wc.DateTime.ya=[olympe.dc.gf];olympe.dc.wc.Number=class{constructor(a){this.C=a}na(){return S(olympe.dc.wc.Number)}K(){return this.C.C()}G(a,b){return this.C.getValue(a,b)}compare(a,b){return a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.na()}",a:[${this.C.ha(a)}]}`}toString(){return`Number(${this.C.toString()})`}};R('olympe.dc.comparators.Number',olympe.dc.wc.Number);olympe.dc.wc.Number.ya=[olympe.dc.gf];olympe.dc.wc.String=class{constructor(a){this.C=a}na(){return S(olympe.dc.wc.String)}K(){return this.C.C()}G(a,b){return olympe.D.va([this.C.getValue(a,b)],c=>c.toLowerCase(),olympe.D.Oa)}compare(a,b){return void 0===a?void 0===b?0:1:a!==b?a>b?1:-1:0}ha(a){return`{"c":"${this.na()}",a:[${this.C.ha(a)}]}`}toString(){return`String(${this.C.toString()})`}};R('olympe.dc.comparators.String',olympe.dc.wc.String);olympe.dc.wc.String.ya=[olympe.dc.gf];olympe.dc.$={};let Kl=0;olympe.dc.$.hg=class{constructor(){this.id=Kl++}na(){return'CustomLocalPredicate#'+this.id}F(){return[]}C(){throw Error('Test function was not implemented.');}ha(){return`{"c":"${this.na()}"}`}toString(){return this.na()+'()'}};olympe.dc.$.hg.ya=[olympe.dc.Aa];olympe.dc.$.Pk=class{constructor(a,b){this.G=a;this.K=b}na(){}F(){return[this.G.C(),this.K.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.K.getValue(a,b)],(c,d)=>{c=c.valueOf();d=d.valueOf();return olympe.D.Xb(this.O('string'===typeof c?c:Number(c),'string'===typeof d?d:Number(d)))},olympe.D.fa))}O(){}ha(a){return'{"c":"'+this.na()+'","a":['+this.G.ha(a)+','+this.K.ha(a)+']}'}toString(){return this.na().replace(/^.+\./,'')+'('+this.G.toString()+','+this.K.toString()+')'}};
896
898
  olympe.dc.$.Pk.ya=[olympe.dc.Aa];olympe.dc.$.Fd=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}na(){return S(olympe.dc.$.Fd)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.va(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Xb(c.every(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'And('+this.$.map(a=>
897
- a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.Fd);olympe.dc.$.Fd.ya=[olympe.dc.Aa];olympe.dc.$.Xk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.va([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Xb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.fa))}na(){return S(olympe.dc.$.Xk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.hb(this.G)?this.G.Da.Eb.valueOf():this.G.valueOf();return'{"c":"'+this.na()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.hb(this.G)?this.G.Da.Eb.valueOf():this.G.valueOf();
898
- return this.na().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc.$.Xk);olympe.dc.$.Xk.ya=[olympe.dc.Aa];olympe.dc.$.hf=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}na(){return S(olympe.dc.$.hf)}F(){return[this.source.C(),this.value.C()]}sb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.va([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Xb(c.includes(d))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Hl(a,this.G);
899
- return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Gl(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};R('olympe.dc.predicates.Contains',olympe.dc.$.hf);olympe.dc.$.hf.ya=[olympe.dc.Aa];olympe.dc.$.te=class{constructor(a,b){this.G=a;this.J=b}na(){return S(olympe.dc.$.te)}F(){return[this.G.C(),this.J.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.J.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Ad?c.Ad(d):'object'===typeof d&&void 0!==d.Ad?d.Ad(c):olympe.D.Xb(c.valueOf()===d.valueOf()),olympe.D.fa,'Test equal predicate'))}ha(a){return'{"c":"'+this.na()+'","a":['+this.G.ha(a)+','+this.J.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.J.toString()+
900
- ')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.te);olympe.dc.$.te.ya=[olympe.dc.Aa];olympe.dc.$.dt=class extends olympe.dc.$.te{constructor(a,b){super(a,new olympe.dc.Za.Le(b))}};olympe.dc.$.dt.ya=[olympe.dc.Aa];olympe.dc.$.Aj=class extends olympe.dc.$.Pk{constructor(a,b){super(a,b)}na(){return S(olympe.dc.$.Aj)}O(a,b){return a>b}};R('olympe.dc.predicates.Greater',olympe.dc.$.Aj);olympe.dc.$.ji=class{constructor(a,b,c){this.pb=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.ga(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.ze?this.pb.push(new Kl(c.X(),c.Ja(),c.G,c.F)):this.pb.push(new Kl(olympe.dc.ga(c),b[d],1,1))}na(){return S(olympe.dc.$.ji)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Ub(olympe.D.ic(Boolean),!1)),d=olympe.Y.Mc(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
901
- c.getContext().eb()||c.getContext().od()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Ll(g[h],e,a,d+h);af(e,b,a,d);c.getContext().onDestroy(()=>{Ze(e,b,d)});return c.tb()}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelated',olympe.dc.$.ji);
902
- function Ll(a,b,c,d){const e=Object.create(null);d+=olympe.Y.Nh();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.F(h,a,l))}};return(g,h)=>f(g,h,0)}class Kl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ja()}, ${this.F}, ${this.C}`}}olympe.dc.$.ji.ya=[olympe.dc.Aa];olympe.dc.$.yl=class{constructor(a,b,c){this.pb=[];this.G=void 0!==c?c.map(olympe.dc.ga):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.ze?this.pb.push(new Ml(c.X(),c.Ja(),c.G,c.F)):this.pb.push(new Ml(olympe.dc.ga(c),b[d],1,1))}na(){return S(olympe.dc.$.yl)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Ub(olympe.D.ic(Boolean),!1)),d=olympe.dc.ia(),e=olympe.Y.Nh();let f=(k,l,n)=>{l&&(null===this.G||this.G.includes(n))&&k(1)};
903
- const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Nl(g[k],d,f,e+k);let h=0;af(d,b,f.bind(null,k=>{c.getContext().od()||c.getContext().eb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Ze(d,b,e));return c.tb()}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.yl);
904
- function Nl(a,b,c,d){const e=a.G,f=a.O,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.Y.Nh();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.F&&c(y=>
905
- {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&V(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.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Ml extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ja()}, ${this.F}, ${this.C}`}}olympe.dc.$.yl.ya=[olympe.dc.Aa];olympe.dc.$.mi=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ga(b))}):this.G.add(olympe.dc.ga(a))}na(){return S(olympe.dc.$.mi)}F(){return[]}C(a,b){const c=a.run(()=>Ub(olympe.D.ic(olympe.D.fa),olympe.D.fa.C)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ga(olympe.dc.CloudObject))c.update(olympe.D.Xb(this.G.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
906
- this.G.has(k)?(c.update(olympe.D.fa.F),f()):(h=new Ol(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.relation,g,h.id))}};a=new Ol(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.tb()}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Ol{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.Nh()}}
907
- R('olympe.dc.predicates.InstanceOf',olympe.dc.$.mi);olympe.dc.$.mi.ya=[olympe.dc.Aa];olympe.dc.$.ce=class{constructor(a){this.G=a}na(){return S(olympe.dc.$.ce)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.va([this.G.C(a,b)],c=>olympe.D.Xb(!c.valueOf()),olympe.D.fa))}ha(a){return`{"c":"${this.na()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};R('olympe.dc.predicates.Not',olympe.dc.$.ce);olympe.dc.$.ce.ya=[olympe.dc.Aa];olympe.dc.$.xe=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}na(){return S(olympe.dc.$.xe)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.va(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Xb(c.some(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
908
- ')'}};R('olympe.dc.predicates.Or',olympe.dc.$.xe);olympe.dc.$.xe.ya=[olympe.dc.Aa];olympe.dc.$.rf=class{constructor(a,b,c){this.source=a;this.J=b;this.G=void 0===c?!0:c}na(){return S(olympe.dc.$.rf)}F(){return[this.source.C()]}sb(){return this.source}C(a,b){return a.run(()=>olympe.D.va([this.source.getValue(a,b),this.J,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Xb((new RegExp(d)).test(c))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=Hl(a,this.J);a=Hl(a,this.G);return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+
909
- ']}'}toString(){const a=Gl(this.G);return'Regex('+this.source.toString()+','+this.J+','+a+')'}};R('olympe.dc.predicates.Regex',olympe.dc.$.rf);olympe.dc.$.rf.ya=[olympe.dc.Aa];olympe.dc.$.ck=class extends olympe.dc.$.Pk{constructor(a,b){super(a,b)}na(){return S(olympe.dc.$.ck)}O(a,b){return a<b}};R('olympe.dc.predicates.Smaller',olympe.dc.$.ck);olympe.dc.lc={};olympe.dc.lc.lj=class{constructor(){this.T=this.J=this.index=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.J;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.lc.vj(this),this.index=c,this.J=b):this.J=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
910
- [];null!==this.J&&(0<=this.F?Pl(Ql(this.J,this.F),a):a.push(this.index));this.T(a)}}fg(a){this.T=a}};olympe.dc.lc.lj.ya=[olympe.dc.lc.Sa];function El(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.lc.vj(a.C,a));return a.F}function Ql(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Pl(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.vj=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}le(){return this.C}Yf(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class Rl extends olympe.dc.lc.vj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.Z=this.T=this.J=!1;this.G=null}}
911
- function Sl(a,b,c,d,e){const f=Object.create(null),g=a.ka,h=a.J;let k,l,n;a.ea=!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.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.J&&(c.J=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.F&&a.G()}
912
- olympe.dc.lc.Jl=class{constructor(){this.J={};this.ka=[];this.F=null;this.ea=!1;this.T=[];this.aa=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ea){var a=this.ka,b=a.length,c=this.J,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.Z){var f=e,g=this.F;f.Z=!0;f.G=Ql(f,
913
- g)}null!==e.G&&Pl(e.G,this.T)}}this.aa&&this.aa(this.T)}}fg(a){this.aa=a}C(a,b,c){let d=this.J[c];a?void 0===d?(d=new Rl(this,c,b),this.J[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.lc.Jl.ya=[olympe.dc.lc.Sa];olympe.dc.lc.Sa=class{constructor(){}C(){}O(){}Z(){}G(){}fg(){}};function Tl(a,b){olympe.D.bf(a.value)?(a.node=olympe.D.dn(a.value,b),Ab(a.node)||b()):b()}function Ul(a,b){if(olympe.D.bf(a.value)){const c=olympe.D.$a(),d=a.J;olympe.D.Nc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Tl(a,b)),olympe.D.$a().destroy())})}}
914
- class Vl extends olympe.dc.lc.vj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.J=this.Ma();this.position=this.node=null;this.T=!1;this.G=null}Ma(){const a=olympe.D.Ma(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}eb(){return null===this.value}}
915
- function Wl(a,b){if(!b.eb()){var c=a.F;var d=a.ka,e=b.Ma(),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.Ma();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
916
- function Xl(a){const b=a.ka;a.F.sort((c,d)=>b(c.Ma(),d.Ma()))}
917
- olympe.dc.lc.Yq=class{constructor(a){this.ka=a;this.J=null;this.F=[];this.T=[];this.aa=null;this.ea=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Vl(this,c,d),this.ea.set(b,f),this.O()?Tl(f,()=>Wl(this,f)):(f.position=e.length,e.push(f));else{f=this.ea.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ea.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.J}Z(a){if(null!==this.J)throw Error('Manager already activated (depth='+
918
- this.J+')');this.J=a;Xl(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Ul(d,()=>Wl(this,d))}this.G()}G(){if(null===this.J)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.J;b.T=!0;b.G=Ql(b,c)}0>this.J?this.T.push(e.index):e.G&&Pl(e.G,this.T)}this.aa&&this.aa(this.T)}fg(a){this.aa=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
919
- a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.Yq.ya=[olympe.dc.lc.Sa];function zl(a){if(!a.F){for(let b in a.G)Yl(a.G[b]);a.F=!0}a.J=null;a.O=null}function Cl(a,b,c){a.G[c||'root'].T=b}function Dl(a,b,c){a.G[c||'root'].Yf(b)}function Zl(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=Kg(a.db,b,c,d),e[f]=g);return g}function $l(a,b){a.F||a.C.Yf(b)}function am(a,b,c,d,e){if(!a.F){let f=Zl(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=Zl(a,c,d,olympe.dc.wa.ORIGIN));0===f&&$l(a,b)}}
920
- function bm(a,b){const c=a.G[b];void 0!==c?(a.H&&a.H.debug('Set current block to',b,null!==c.G?'parent = '+c.G.V():''),a.C=c):a.H&&a.H.error('Try to set a block that does not exists:',b)}function cm(a){const b=String(++a.T),c=a.C;a.G[b]=new dm(b,c);em(c,b);c.J||(c.J=()=>bm(a,c.V()));return b}function fm(a,b){const c=a.C;a.C.J=()=>{bm(a,c.V());b()}}function gm(a,b){Yl(b?a.G[b]:a.C)}
921
- olympe.dc.lc.Zq=class{constructor(a,b){this.db=a;this.H=b||null;this.J=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new dm('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=Zl(this,c,d,e),d=this.J[b]||0,this.J[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function em(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function Yl(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
922
- class dm{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.J=this.F=null;this.O=!1}V(){return this.id}Yf(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&Yl(this)}notify(a){const b=this.J,c=this.F;if(this.O)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.Za={};function hm(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.lj,g=new olympe.dc.lc.Zq(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.od()||a.eb()||(h||(Cl(g,()=>{u.Yf();zl(g)}),u.le().fg(l),h=!0),q?k[t]=r:delete k[t],Dl(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.Mc();af(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,El(t,q,b,p))},p);a.onDestroy(()=>{Ze(e,b,p)});e.Ia(b)||zl(g)}
923
- function im(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.G(),g=vg(e,b,a.J,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>wg(e,b,a.J,g))}
924
- olympe.dc.Za.Yh=class{constructor(a,b,c){this.J=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Re||d instanceof olympe.dc.da.ze)||null;this.F=c||null;this.defaultValue=null}na(){}Nb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}$g(a){this.defaultValue=a;return this}Tg(){return this.da}Ud(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ic(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&Ub(c,this.defaultValue);
925
- b=this.F||b;null!==this.da?hm(a,b,this.da,d=>{im(this,d,c)}):im(this,b,c);return c.tb()}ha(a){const b=Hl(a,this.J),c=Hl(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.na()}","a":["${b}",${d},${c}]}`}toString(){const a=Gl(this.J),b=this.F?','+Gl(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.na().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.Yh.ya=[olympe.dc.hk];olympe.dc.Za.An=class{constructor(a,b){if(olympe.D.bf(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.Rg(e,olympe.dc.CloudObject.extendRel,olympe.dm.ye);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.X():d=new olympe.dc.Za.Ei(c,b);break;case olympe.dm.Number.P.X():d=new olympe.dc.Za.wi(c,
926
- b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.Za.mj(c,b);break;case olympe.dm.DateTime.P.X():d=new olympe.dc.Za.ci(c,b)}this.F=d}na(){return this.F.na()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Za.An.ya=[olympe.dc.hk];olympe.dc.Za.mj=class extends olympe.dc.Za.Yh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.mj)}G(){return olympe.dc.nb.Em}Nb(){return olympe.D.fa}};R('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.mj);olympe.dc.Za.Le=class{constructor(a){this.value=a}na(){return S(olympe.dc.Za.Le)}C(){return[]}getValue(){return this.value}ha(a){a=Hl(a,this.value);return`{"c":"${this.na()}","a":[${a}]}`}toString(){return`Constant(${Gl(this.value)})`}};R('olympe.dc.valuedefs.Constant',olympe.dc.Za.Le);olympe.dc.Za.Le.ya=[olympe.dc.hk];olympe.dc.Za.ci=class extends olympe.dc.Za.Yh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.ci)}G(){return olympe.dc.nb.Fm}Nb(){return olympe.D.ib}};R('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.ci);olympe.dc.Za.wi=class extends olympe.dc.Za.Yh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.wi)}G(){return olympe.dc.nb.Gm}Nb(){return olympe.D.ba}};R('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.wi);olympe.dc.Za.Ei=class extends olympe.dc.Za.Yh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.Ei)}G(){return olympe.dc.nb.Hm}Nb(){return olympe.D.Oa}};R('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Ei);olympe.dc.Za.Gi=class{na(){return S(olympe.dc.Za.Gi)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.na()+'","a":[]}'}toString(){return'Tag()'}};R('olympe.dc.valuedefs.Tag',olympe.dc.Za.Gi);olympe.dc.Za.Gi.ya=[olympe.dc.hk];olympe.dc.da={};olympe.dc.da.di=class{Nb(){return null}na(){return S(olympe.dc.da.di)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,El(h,!0,f,f))):(d[f]++,$l(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,El(h,!1,f,f)))}}ha(){return'{"c":"'+this.na()+'"}'}toString(){return'Distinct()'}};R('olympe.dc.transformers.Distinct',olympe.dc.da.di);olympe.dc.da.di.ya=[olympe.dc.tf];olympe.dc.da.jf=class{constructor(a){this.F=a}Nb(){return null}na(){return S(olympe.dc.da.jf)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&$l(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,El(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.F.C(a,g);olympe.D.hb(n)&&(n=n.Da);olympe.D.Ff(n)?(b.F||void 0!==olympe.D.Ma(n)||$l(b,h),e[l]=n,a.run(()=>{olympe.D.Nc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
927
- d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.na()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.jf);olympe.dc.da.jf.ya=[olympe.dc.tf,olympe.dc.nq];olympe.dc.da.rl=class{constructor(a,b,c,d){this.F=new olympe.dc.Na.Relation(olympe.dc.ga(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Na.Relation(olympe.dc.ga(b),d||olympe.dc.wa.DESTINATION)}Nb(){return yf(this.F)}na(){return S(olympe.dc.da.rl)}C(a,b,c){const d=olympe.dc.ia(),e={},f=this.F.X(),g=this.F.Ja(),h=this.G.X(),k=this.G.Ja();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.Y.xb(u+g+(f+'_'+r)+z,20),B=El(t,!0,z,A);l=r;n=()=>{c(!1,z,A,El(t,!1,z,A))};b.register(A,
928
- u,x,f,g);c(!0,z,A,B)},y.Vr=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 B=Object.keys(e),O=B.length,M=0;M<O;M++){let xa=e[B[M]];xa.Vr<y&&(y=xa.Vr,A=xa)}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),V(d,y,this.F,p.bind(this,r,t,u,y),u+'_val'),V(d,y,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(y,this.G,u+'_follow'),d.F(y,this.F,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ha(){return'{"c":"'+this.na()+'","a":["'+this.F.toString()+
929
- '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.rl);olympe.dc.da.rl.ya=[olympe.dc.tf];olympe.dc.da.oh=class{constructor(a,b){this.start=a;this.F=b}Nb(){return null}na(){return S(olympe.dc.da.oh)}C(a,b,c){const d=new olympe.dc.lc.Jl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);Sl(d,e,f,n,c)}};a.run(()=>olympe.D.Nc([this.start,this.F],(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.le().fg(t=>{e=t;gm(b,l)}),Cl(b,()=>r.Yf(),l),h=!0);d.C(n,p,q,null);Dl(b,q,l)}}ha(a){return'{"c":"'+
930
- this.na()+'","a":['+Hl(a,this.start)+','+Hl(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Ma(this.start)},${olympe.D.Ma(this.F)})`}};R('olympe.dc.transformers.Limit',olympe.dc.da.oh);olympe.dc.da.oh.ya=[olympe.dc.tf];function jm(a){return a.pb.map(b=>b.X())}
931
- olympe.dc.da.Gj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.pb=a.map(c=>new olympe.dc.Na.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}na(){return S(olympe.dc.da.Gj)}Ja(){return this.direction}C(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.X();p=olympe.Y.xb(g+k.Ja()+p+n,20);const q=El(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.pb.forEach(l=>{am(b,h,g,l.X(),l.Ja());e(g,h,k,l)}):this.pb.forEach(l=>
932
- {d.F(g,l,h)})}}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(jm(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ja()+'['+jm(this).join(',')+'])'}};R('olympe.dc.transformers.MultiRelated',olympe.dc.da.Gj);olympe.dc.da.Gj.ya=[olympe.dc.tf];olympe.dc.da.ze=class extends olympe.dc.Na.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Nb(){return yf(this)}na(){return S(olympe.dc.da.ze)}C(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Ja(),l=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){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.Y.xb(q+k+(h+'_'+p)+t[u],20);b.register(y,
933
- q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.F&&l(p,t,x);p>=this.G?c(u,x,t,El(r,u,x,t)):am(b,t,x,h,k);0<=this.F&&p>=this.F||(u?e[x]||(e[x]=!0,V(d,x,this,(y,z)=>{const A=p+1,B=olympe.Y.xb(t+k+(h+'_'+A)+z,20);n(A,x,r,B,y,z)},t)):(d.F(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.na()+'","a":["'+this.X()+'","'+this.Ja()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Ja()+this.X()+'['+this.G+'..'+this.F+'])'}};
934
- R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.ze);olympe.dc.da.ze.ya=[olympe.dc.tf];olympe.dc.da.Re=class extends olympe.dc.Na.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Nb(){return yf(this)}na(){return S(olympe.dc.da.Re)}cc(){return new olympe.dc.da.Re(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(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?V(d,h,this,(n,p)=>{const q=olympe.Y.xb(k+f+e+p,20),r=El(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
935
- this.na()+'","a":["'+this.X()+'","'+this.Ja()+'"]}'}toString(){return'Related('+this.Ja()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.Re);olympe.dc.da.Re.ya=[olympe.dc.tf];olympe.dc.da.Gg=class{constructor(a,b){this.Fb=a;this.F=void 0===b?!0:!!b}Nb(){return null}na(){return S(olympe.dc.da.Gg)}Ng(){return this.Fb}G(){return[this.Fb.J()]}C(a,b,c){const d=new olympe.dc.lc.Yq(a.G(this.F?this.Fb.compare.bind(this.Fb):(e,f)=>this.Fb.compare(f,e)));return(e,f,g)=>{var h=e?this.Fb.G(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.na()+'","a":['+this.Fb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.Fb.toString()+','+JSON.stringify(this.F)+
936
- ')'}};R('olympe.dc.transformers.Sort',olympe.dc.da.Gg);olympe.dc.da.Gg.ya=[olympe.dc.tf,olympe.dc.nq];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].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,El(q,n,p,h))}const h=olympe.Y.Mc(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.D.Nc([a.F],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&&(af(a,e,c,d),olympe.D.$a().Z(()=>Ze(a,e,d)))}
937
- olympe.dc.da.uf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.za?(this.F=a.Ud(),this.da=a.El()):(this.F=a,b&&(this.da=b))}Nb(){return null}na(){return S(olympe.dc.da.uf)||''}Tg(){return this.da}Ud(){return this.F}C(a,b,c){const d=new olympe.dc.lc.Jl,e=new olympe.dc.lc.lj;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.F||(b.C.C=p[p.length-1]):gm(b);Sl(d,p,0,p.length,c)});bm(b,n);km(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.$a();u.od()||
938
- u.eb()||(k||(t.le().fg(x=>{g=x;gm(b,n)}),Cl(b,()=>t.Yf(),n),k=!0),d.C(p,q,r),Dl(b,r,n))});bm(b,l);return(p,q,r,t)=>{h||(t.le().fg(u=>{f=u;gm(b,l)}),Cl(b,()=>t.Yf(),l),h=!0);d.C(p,q,r,l);Dl(b,r,l)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.na()+'","a":['+Hl(a,this.F)+','+b+']}'}toString(){const a=olympe.D.hb(this.F)?'N:'+this.F.Da.V():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
939
- R('olympe.dc.transformers.Union',olympe.dc.da.uf);olympe.dc.da.uf.ya=[olympe.dc.tf];olympe.dc.da.Fq={jA:1,vt:-1,ut:0};olympe.dc.da.LB={Ry:!0,rz:!1};olympe.dc.kc.R={Ap:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={zp:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.zp,!1);D(a,olympe.dc.kc.R.Ap,olympe.dc.kc.ku,olympe.dc.query.R.Ca,olympe.dc.R.gh,olympe.dc.transaction.R.Ea,olympe.dc.query.R.Qj,new olympe.W.ja(olympe.dc.U.zh),new olympe.W.ja(olympe.dc.kc.U.zp))});olympe.W.run([olympe.dc.kc.R.Ap],a=>{olympe.dc.kc.Yw=()=>a});function mm(a){const b=olympe.dc.ia(),c=new Map;b.Lr(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}
940
- olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static Vc(a,b,c,...d){b=olympe.dc.ga(b);var e=cf(b);(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Nr();a=olympe.dc.ga(a);var c=b.db.model(a);c=bf(b,c);if(null===c)throw new olympe.dc.$p(a);c=c.instantiate(a,b.F);b.C.C.kb([a]);b.Na.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ia(olympe.dc.ga(a))}static fw(a,
941
- 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.Uh(c);a.forEach((k,l)=>{d.Ia(olympe.dc.ga(l))?Z(h,l,k):(l=f(l))&&Z(h,l,k)});g.ob((k,l)=>{k||olympe.ma.gb('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Xv(){return this.get(this)}static Bk(a){return olympe.dc.pa.Bk(a)}static Cb(){return olympe.dc.ia().bb(this,olympe.dc.CloudObject.propertyRel).map(a=>
942
- new olympe.dc.Na.Property(a))}static xd(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.cj).map(b=>new olympe.dc.Na.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Dr).map(b=>new olympe.dc.Na.Relation(b,olympe.dc.wa.ORIGIN)))}static Lc(a){return olympe.dc.CloudObject.get(a)}static Pr(a){var b=bf(olympe.dc.Nr(),olympe.dc.ga(a));b=b&&b.F;return new olympe.dc.za(olympe.dc.ga(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}na(){return this.wb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||
943
- (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Gf(){return this.db.Gf(this)}sb(){return this.db.source(this)}Vw(){return this.db.Sh(this)?olympe.dc.Xd().fromModel(this):null}Kr(){return olympe.D.va([this.na()],a=>olympe.D.Ab(a),olympe.D.Oa,'getDisplayName',olympe.D.Ab('('+this.toString()+')'))}ec(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
944
- {const f=olympe.dc.nb.zc(this.db.Ra(this.tag,b));c||null!==f||e.next(f);const g=vg(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.zc(h))});d.Z(()=>{e.complete();wg(this.db,this.tag,b,g)});return()=>wg(this.db,this.tag,b,g)})}gy(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=xg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Na.Property(e),null]):c.next([new olympe.dc.Na.Property(e),f])});b.Z(()=>{c.complete();yg(this.db,this.tag,d)});return()=>yg(this.db,
945
- this.tag,d)})}hy(a){return this.observe(olympe.D.$a(),a)}get(a){return olympe.dc.nb.zc(this.db.Ra(this.tag,a))}Ra(a){return this.get(a)}fb(a){return olympe.dc.pa.from(this).fb(a)}pk(a){return olympe.dc.hd.from(this).fb(a)}zc(){return this}Fw(){return this.qc(olympe.dc.CloudObject.bw,olympe.dc.CloudObject)}Pm(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Df(a,b,c){const d=olympe.D.ic(c,'Sync valueType'),e=vg(this.db,this.tag,a,olympe.D.$a().G(f=>{b&&null!==f&&void 0!==f&&
946
- (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>wg(this.db,this.tag,a,e));return d.getContext()}wb(a){return L(this.Df(a,olympe.dc.nb.Hm,olympe.D.Oa))}cd(a){return L(this.Df(a,olympe.dc.nb.Gm,olympe.D.ba))}Qg(a){return L(this.Df(a,olympe.dc.nb.Em,olympe.D.fa))}Xi(a){return L(this.Df(a,olympe.dc.nb.Fm,olympe.D.ib))}Tr(){return L(this.Df(olympe.dm.Color.valueProp,olympe.dc.nb.wr,olympe.D.Color))}Ur(){return L(this.Df(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.xr,
947
- olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.da.Re?a:new olympe.dc.da.Re(a.X(),a.Ja());return new olympe.dc.za(this.X(),a,b)}qc(a,b){return this.bb(a,b).Gc()}Gr(a,b){const c=this.db,d=olympe.Y.Mc(),e=olympe.D.$a(),f=new Map;V(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}Ky(){return new olympe.dc.za(this.X(),[],wf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
948
- [],this.constructor)).transform(...a)}Oc(){return this.Kr()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ia(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Wb().name()},this.Pc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Pc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ia(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.zc(d))});return c}Ga(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
949
- 'function'===typeof a?olympe.dc.oa.ec(a)===this.X():!1}Ad(a){return olympe.D.va([a],b=>olympe.D.Xb(this.Ga(b)),olympe.D.fa)}iw(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.wa.ORIGIN;for(const [e,f,g]of Ig(b,this))f===d?a.jc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.jc(e,this,g);a.delete(this,olympe.dc.Ob.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ga;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Pc;
950
- olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.pk;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.fb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ra;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.hy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.gy;
951
- olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.ec;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Gf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Wb;
952
- 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.Pr;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Lc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.xd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Bk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Xv;
953
- olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.fw;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.oa.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.VD=olympe.dc.CloudObject.P.la(olympe.dc.sp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.la('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
954
- olympe.dc.CloudObject.GD=olympe.dc.CloudObject.P.la('ff023000000000000012');olympe.dc.CloudObject.cj=olympe.dc.CloudObject.P.ra('ff02200000000000000a');olympe.dc.CloudObject.Dr=olympe.dc.CloudObject.P.ra('ff02200000000000000b',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.pD=olympe.dc.CloudObject.P.ra('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.gD=olympe.dc.CloudObject.P.ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.ra('ff02200000000000000c');
899
+ a.toString()).join(',')+')'}};R('olympe.dc.predicates.And',olympe.dc.$.Fd);olympe.dc.$.Fd.ya=[olympe.dc.Aa];olympe.dc.$.Xk=class{constructor(a,b){this.G=a;this.value=b}C(a,b){return a.run(()=>olympe.D.va([this.G,this.value.getValue(a,b)],(c,d)=>{c=c.valueOf();return olympe.D.Xb((Number(c)&Number(d.valueOf()))===Number(c))},olympe.D.fa))}na(){return S(olympe.dc.$.Xk)}F(){return[this.value.C()]}ha(a){const b=olympe.D.ib(this.G)?this.G.Da.Eb.valueOf():this.G.valueOf();return'{"c":"'+this.na()+'","a":['+b+','+this.value.ha(a)+']}'}toString(){const a=olympe.D.ib(this.G)?this.G.Da.Eb.valueOf():this.G.valueOf();
900
+ return this.na().replace(/^.+\./,'')+'('+a.toString()+','+this.value.toString()+')'}};R('olympe.dc.predicates.BitMask',olympe.dc.$.Xk);olympe.dc.$.Xk.ya=[olympe.dc.Aa];olympe.dc.$.hf=class{constructor(a,b,c){this.source=a;this.value=b;this.G=c?c:!1}na(){return S(olympe.dc.$.hf)}F(){return[this.source.C(),this.value.C()]}sb(){return this.source}getValue(){return this.value}C(a,b){return a.run(()=>olympe.D.va([this.source.getValue(a,b),this.value.getValue(a,b),this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Xb(c.includes(d))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=this.value.ha(a);a=Il(a,this.G);
901
+ return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+']}'}toString(){const a=Hl(this.G);return'Contains('+this.source.toString()+','+this.value.toString()+','+a+')'}};R('olympe.dc.predicates.Contains',olympe.dc.$.hf);olympe.dc.$.hf.ya=[olympe.dc.Aa];olympe.dc.$.se=class{constructor(a,b){this.G=a;this.K=b}na(){return S(olympe.dc.$.se)}F(){return[this.G.C(),this.K.C()]}C(a,b){return a.run(()=>olympe.D.va([this.G.getValue(a,b),this.K.getValue(a,b)],(c,d)=>'object'===typeof c&&void 0!==c.Ad?c.Ad(d):'object'===typeof d&&void 0!==d.Ad?d.Ad(c):olympe.D.Xb(c.valueOf()===d.valueOf()),olympe.D.fa,'Test equal predicate'))}ha(a){return'{"c":"'+this.na()+'","a":['+this.G.ha(a)+','+this.K.ha(a)+']}'}toString(){return'Equals('+this.G.toString()+','+this.K.toString()+
902
+ ')'}};R('olympe.dc.predicates.Equals',olympe.dc.$.se);olympe.dc.$.se.ya=[olympe.dc.Aa];olympe.dc.$.et=class extends olympe.dc.$.se{constructor(a,b){super(a,new olympe.dc.Za.Le(b))}};olympe.dc.$.et.ya=[olympe.dc.Aa];olympe.dc.$.Aj=class extends olympe.dc.$.Pk{constructor(a,b){super(a,b)}na(){return S(olympe.dc.$.Aj)}O(a,b){return a>b}};R('olympe.dc.predicates.Greater',olympe.dc.$.Aj);olympe.dc.$.ki=class{constructor(a,b,c){this.pb=[];this.G=c instanceof Array?c:void 0!==c?[olympe.dc.ga(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.ye?this.pb.push(new Ll(c.X(),c.Ja(),c.G,c.F)):this.pb.push(new Ll(olympe.dc.ga(c),b[d],1,1))}na(){return S(olympe.dc.$.ki)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Ub(olympe.D.ic(Boolean),!1)),d=olympe.Y.Nc(),e=olympe.dc.ia();let f=0;a=(h,k)=>{0!==this.G.length&&!this.G.includes(k)||
903
+ c.getContext().eb()||c.getContext().od()||(f+=h?1:-1,c.update(0<f))};const g=this.pb;for(let h=g.length-1;0<=h;h--)a=Ml(g[h],e,a,d+h);af(e,b,a,d);c.getContext().onDestroy(()=>{Ze(e,b,d)});return c.tb()}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(0!==this.G.length?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelated('+(0!==this.G.length?'#'+this.G.toString()+', ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelated',olympe.dc.$.ki);
904
+ function Ml(a,b,c,d){const e=Object.create(null);d+=olympe.Y.Oh();const f=(g,h,k)=>{k>=a.F&&c(g,h);if(!(0<=a.C&&k>=a.C)){var l=d+k;g?e[h]||(e[h]=!0,V(b,h,a,(n,p)=>{f(n,p,k+1)},l)):(delete e[h],b.F(h,a,l))}};return(g,h)=>f(g,h,0)}class Ll extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d}ha(){return`${this.X()}, ${this.Ja()}, ${this.F}, ${this.C}`}}olympe.dc.$.ki.ya=[olympe.dc.Aa];olympe.dc.$.yl=class{constructor(a,b,c){this.pb=[];this.G=void 0!==c?c.map(olympe.dc.ga):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.ye?this.pb.push(new Nl(c.X(),c.Ja(),c.G,c.F)):this.pb.push(new Nl(olympe.dc.ga(c),b[d],1,1))}na(){return S(olympe.dc.$.yl)}F(){return[this.pb.reduce((a,b)=>a.concat(b),[])]}C(a,b){const c=a.run(()=>Ub(olympe.D.ic(Boolean),!1)),d=olympe.dc.ia(),e=olympe.Y.Oh();let f=(k,l,n)=>{l&&(null===this.G||this.G.includes(n))&&k(1)};
905
+ const g=this.pb;for(let k=g.length-1;0<=k;k--)f=Ol(g[k],d,f,e+k);let h=0;af(d,b,f.bind(null,k=>{c.getContext().od()||c.getContext().eb()||(h+=k,c.update(0<h))}),e);a.onDestroy(()=>Ze(d,b,e));return c.tb()}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(this.pb.map(a=>a.ha()))+(null!==this.G?',"'+this.G.toString():'')+'"]}'}toString(){return'HasRelatedTree('+(null!==this.G?'#['+this.G.toString()+'], ':'')+this.pb.map(a=>a.ha())+')'}};R('olympe.dc.predicates.HasRelatedTree',olympe.dc.$.yl);
906
+ function Ol(a,b,c,d){const e=a.G,f=a.O,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.Y.Oh();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.F&&c(y=>
907
+ {e.set(r,(e.get(r)||0)+y);l(y)},q,r),(0>a.C||n<=a.C)&&r!==p&&V(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.F(r,a,t))};return(l,n,p)=>k(l,0,'origin',n,p)}class Nl extends olympe.dc.query.Relation{constructor(a,b,c,d){super(a,b,1!==c||1!==d);this.F=c;this.C=d;this.O=new Map;this.G=new Map}ha(){return`${this.X()}, ${this.Ja()}, ${this.F}, ${this.C}`}}olympe.dc.$.yl.ya=[olympe.dc.Aa];olympe.dc.$.ni=class{constructor(a){this.G=new Set;a instanceof Array?a.forEach(b=>{this.G.add(olympe.dc.ga(b))}):this.G.add(olympe.dc.ga(a))}na(){return S(olympe.dc.$.ni)}F(){return[]}C(a,b){const c=a.run(()=>Ub(olympe.D.ic(olympe.D.fa),olympe.D.fa.C)),d=olympe.dc.ia();let e=[];const f=()=>{e.forEach(h=>{d.F(h.tag,h.relation,h.id)});e=[]},g=(h,k)=>{if(h)if(k===olympe.dc.ga(olympe.dc.CloudObject))c.update(olympe.D.Xb(this.G.has(k))),f();else{for(const l of e)if(l.tag===k)throw Error(`You should never extend a model to itself (${k})`);
908
+ this.G.has(k)?(c.update(olympe.D.fa.F),f()):(h=new Pl(k,olympe.dc.CloudObject.extendRel),e.push(h),V(d,h.tag,h.relation,g,h.id))}};a=new Pl(b,olympe.dc.CloudObject.modelRel);e.push(a);V(d,a.tag,a.relation,g,a.id);c.getContext().onDestroy(f);return c.tb()}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(Array.from(this.G))+']}'}toString(){return'InstanceOf('+Array.from(this.G).join(', ')+')'}};class Pl{constructor(a,b){this.tag=a;this.relation=b;this.id=olympe.Y.Oh()}}
909
+ R('olympe.dc.predicates.InstanceOf',olympe.dc.$.ni);olympe.dc.$.ni.ya=[olympe.dc.Aa];olympe.dc.$.ce=class{constructor(a){this.G=a}na(){return S(olympe.dc.$.ce)}F(){return this.G.F()}C(a,b){return a.run(()=>olympe.D.va([this.G.C(a,b)],c=>olympe.D.Xb(!c.valueOf()),olympe.D.fa))}ha(a){return`{"c":"${this.na()}","a":[${this.G.ha(a)}]}`}toString(){return'Not('+this.G.toString()+')'}};R('olympe.dc.predicates.Not',olympe.dc.$.ce);olympe.dc.$.ce.ya=[olympe.dc.Aa];olympe.dc.$.we=class{constructor(a){this.$=[];for(let b=arguments.length,c=0;c<b;c++)Array.isArray(arguments[c])?this.$=this.$.concat(arguments[c]):this.$.push(arguments[c])}na(){return S(olympe.dc.$.we)}F(){return this.$.reduce((a,b)=>a.concat(b.F()),[])}C(a,b){return a.run(()=>olympe.D.va(this.$.map(c=>c.C(a,b)),(...c)=>olympe.D.Xb(c.some(d=>d.valueOf())),olympe.D.fa))}ha(a){const b=this.$.map(c=>c.ha(a));return'{"c":"'+this.na()+'","a":['+b.join(',')+']}'}toString(){return'Or('+this.$.map(a=>a.toString()).join(',')+
910
+ ')'}};R('olympe.dc.predicates.Or',olympe.dc.$.we);olympe.dc.$.we.ya=[olympe.dc.Aa];olympe.dc.$.sf=class{constructor(a,b,c){this.source=a;this.K=b;this.G=void 0===c?!0:c}na(){return S(olympe.dc.$.sf)}F(){return[this.source.C()]}sb(){return this.source}C(a,b){return a.run(()=>olympe.D.va([this.source.getValue(a,b),this.K,this.G],(c,d,e)=>{c=String(c);d=String(d);e.valueOf()||(c=c.toLowerCase(),d=d.toLowerCase());return olympe.D.Xb((new RegExp(d)).test(c))},olympe.D.fa))}ha(a){const b=this.source.ha(a),c=Il(a,this.K);a=Il(a,this.G);return'{"c":"'+this.na()+'","a":['+b+','+c+','+a+
911
+ ']}'}toString(){const a=Hl(this.G);return'Regex('+this.source.toString()+','+this.K+','+a+')'}};R('olympe.dc.predicates.Regex',olympe.dc.$.sf);olympe.dc.$.sf.ya=[olympe.dc.Aa];olympe.dc.$.ck=class extends olympe.dc.$.Pk{constructor(a,b){super(a,b)}na(){return S(olympe.dc.$.ck)}O(a,b){return a<b}};R('olympe.dc.predicates.Smaller',olympe.dc.$.ck);olympe.dc.lc={};olympe.dc.lc.lj=class{constructor(){this.T=this.K=this.index=this.F=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}C(a,b,c){b=this.K;if(a&&null!==b)throw Error('The AutoManger handles only a single item.');a?(b=new olympe.dc.lc.vj(this),this.index=c,this.K=b):this.K=this.index=null;return b}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(null!==this.T){const a=
912
+ [];null!==this.K&&(0<=this.F?Ql(Rl(this.K,this.F),a):a.push(this.index));this.T(a)}}fg(a){this.T=a}};olympe.dc.lc.lj.ya=[olympe.dc.lc.Sa];function Fl(a,b,c,d){b?a.O[d]=c:delete a.O[d];null===a.F&&(a.F=new olympe.dc.lc.vj(a.C,a));return a.F}function Rl(a,b){for(let c=0;c<b;c++)if(null!==a.F)a=a.F;else break;return a}function Ql(a,b){a=a.O;if(null!==a)for(let c in a)Object.prototype.hasOwnProperty.call(a,c)&&b.push(c)}olympe.dc.lc.vj=class{constructor(a,b){this.C=a;this.depth=b?b.depth+1:0;this.O=Object.create(null);this.F=null}ke(){return this.C}Yf(){this.C.O()?this.C.G():this.C.Z(this.depth-1)}};class Sl extends olympe.dc.lc.vj{constructor(a,b,c){super(a);this.index=b;this.tag=c;this.Z=this.T=this.K=!1;this.G=null}}
913
+ function Tl(a,b,c,d,e){const f=Object.create(null),g=a.ka,h=a.K;let k,l,n;a.ea=!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.K||(c.K=!0,e(!0,c.tag,c.index,c)));for(k in f)Object.prototype.hasOwnProperty.call(f,k)&&(c=h[k],c.K&&(c.K=!1,e(!1,c.tag,c.index,c)),c.T&&(c.G=null,delete h[k]),delete f[k]);a.ea=!1;null!==a.F&&a.G()}
914
+ olympe.dc.lc.Jl=class{constructor(){this.K={};this.ka=[];this.F=null;this.ea=!1;this.T=[];this.aa=null}O(){return null!==this.F}Z(a){if(null!==this.F)throw Error('Manager already activated (depth='+this.F+')');this.F=a;this.G()}G(){if(null===this.F)throw Error('Manager not activated, need to set a depth before updating ranks');if(!this.ea){var a=this.ka,b=a.length,c=this.K,d;for(d=this.T.length=0;d<b;d++){var e=c[a[d]];if(0>this.F)this.T.push(e.index);else{if(!e.Z){var f=e,g=this.F;f.Z=!0;f.G=Rl(f,
915
+ g)}null!==e.G&&Ql(e.G,this.T)}}this.aa&&this.aa(this.T)}}fg(a){this.aa=a}C(a,b,c){let d=this.K[c];a?void 0===d?(d=new Sl(this,c,b),this.K[c]=d):(d.tag=b,d.T=!1):void 0!==d&&(d.T=!0);return d}};olympe.dc.lc.Jl.ya=[olympe.dc.lc.Sa];olympe.dc.lc.Sa=class{constructor(){}C(){}O(){}Z(){}G(){}fg(){}};function Ul(a,b){olympe.D.bf(a.value)?(a.node=olympe.D.dn(a.value,b),Ab(a.node)||b()):b()}function Vl(a,b){if(olympe.D.bf(a.value)){const c=olympe.D.$a(),d=a.K;olympe.D.Oc([a.value],e=>{d!==e.valueOf()&&(c.run(()=>Ul(a,b)),olympe.D.$a().destroy())})}}
916
+ class Wl extends olympe.dc.lc.vj{constructor(a,b,c){super(a);this.index=b;this.value=c;this.K=this.Ma();this.position=this.node=null;this.T=!1;this.G=null}Ma(){const a=olympe.D.Ma(this.value);return a?a.valueOf():a}destroy(){this.node&&(this.node.destroy(),this.node=null);this.G=this.value=null}eb(){return null===this.value}}
917
+ function Xl(a,b){if(!b.eb()){var c=a.F;var d=a.ka,e=b.Ma(),f=0;let g=c.length,h=0,k;for(null!==b.position&&--g;g>f;){h=Math.floor((f+g)/2);k=d(c[h].K,e);if(0===k||2>g-f){0>k&&null!==b.position&&b.position<=h&&(k=d(c[g].K,e));h=0>k?g:h;break}0>k?f=h:g=h}c=h;b.K=b.Ma();if(c!==b.position){d=a.F;e=d.length;f=b.position;null===f&&(f=e);if(c<f)for(e=f;e>c;e--)d[e]=d[e-1],d[e].position=e;else for(e=f;e<c;e++)d[e]=d[e+1],d[e].position=e;d[c]=b;d[c].position=c;b.T&&a.G()}}}
918
+ function Yl(a){const b=a.ka;a.F.sort((c,d)=>b(c.Ma(),d.Ma()))}
919
+ olympe.dc.lc.Zq=class{constructor(a){this.ka=a;this.K=null;this.F=[];this.T=[];this.aa=null;this.ea=new Map}C(a,b,c,d){b='$'+c;const e=this.F;let f;if(a)f=new Wl(this,c,d),this.ea.set(b,f),this.O()?Ul(f,()=>Xl(this,f)):(f.position=e.length,e.push(f));else{f=this.ea.get(b);if(void 0===f)throw Error('Trying to remove an non-registered item: "'+c+'"');this.ea.delete(b);null!==f.position&&(this.O()?this.remove(f):delete e[f.position]);f.destroy()}return f}O(){return null!==this.K}Z(a){if(null!==this.K)throw Error('Manager already activated (depth='+
920
+ this.K+')');this.K=a;Yl(this);for(let b=0,c=this.F.length;b<c;b++){const d=this.F[b];d.position=b;Vl(d,()=>Xl(this,d))}this.G()}G(){if(null===this.K)throw Error('Manager not activated, need to set a depth before updating ranks');const a=this.F.length;this.T.length=0;for(let d=0;d<a;d++){let e=this.F[d];if(!e.T){var b=e,c=this.K;b.T=!0;b.G=Rl(b,c)}0>this.K?this.T.push(e.index):e.G&&Ql(e.G,this.T)}this.aa&&this.aa(this.T)}fg(a){this.aa=a}remove(a){const b=this.F,c=b.length-1;if(null!==a.position){for(a=
921
+ a.position;a<c;a++)b[a]=b[a+1],b[a].position=a;b.length=c}}};olympe.dc.lc.Zq.ya=[olympe.dc.lc.Sa];function Al(a){if(!a.F){for(let b in a.G)Zl(a.G[b]);a.F=!0}a.K=null;a.O=null}function Dl(a,b,c){a.G[c||'root'].T=b}function El(a,b,c){a.G[c||'root'].Yf(b)}function $l(a,b,c,d){const e=a.O,f=b+d+c;let g=e[f];void 0===g&&(g=Kg(a.db,b,c,d),e[f]=g);return g}function am(a,b){a.F||a.C.Yf(b)}function bm(a,b,c,d,e){if(!a.F){let f=$l(a,c,d,e||olympe.dc.wa.DESTINATION);e||(f+=$l(a,c,d,olympe.dc.wa.ORIGIN));0===f&&am(a,b)}}
922
+ function cm(a,b){const c=a.G[b];void 0!==c?(a.H&&a.H.debug('Set current block to',b,null!==c.G?'parent = '+c.G.V():''),a.C=c):a.H&&a.H.error('Try to set a block that does not exists:',b)}function dm(a){const b=String(++a.T),c=a.C;a.G[b]=new em(b,c);fm(c,b);c.K||(c.K=()=>cm(a,c.V()));return b}function gm(a,b){const c=a.C;a.C.K=()=>{cm(a,c.V());b()}}function hm(a,b){Zl(b?a.G[b]:a.C)}
923
+ olympe.dc.lc.$q=class{constructor(a,b){this.db=a;this.H=b||null;this.K=Object.create(null);this.O=Object.create(null);this.F=!1;this.T=0;this.C=new em('root');this.G=Object.create(null);this.G.root=this.C}register(a,b,c,d,e){this.F||(null!==b&&c&&d&&e?(c=$l(this,c,d,e),d=this.K[b]||0,this.K[b]=++d,this.C.C===b&&c<=d&&(this.C.C=a)):this.C.C=a)}};function fm(a,b){null===a.F&&(a.F=Object.create(null));a.F[b]=!1}function Zl(a){a.O=!0;null!==a.G&&a.G.notify(a.id)}
924
+ class em{constructor(a,b){this.id=a;this.G=b||null;this.C=this.T=this.K=this.F=null;this.O=!1}V(){return this.id}Yf(a){const b=this.T;if(this.O||this.C===a||null===a)b&&b(),!b&&Zl(this)}notify(a){const b=this.K,c=this.F;if(this.O)b&&b();else if(!c[a]){a=c[a]=!0;for(let d in c)if(!c[d]){a=!1;break}a&&b&&b()}}};olympe.dc.Za={};function im(a,b,c,d){const e=olympe.dc.ia(),f=new olympe.dc.lc.lj,g=new olympe.dc.lc.$q(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.od()||a.eb()||(h||(Dl(g,()=>{u.Yf();Al(g)}),u.ke().fg(l),h=!0),q?k[t]=r:delete k[t],El(g,t))};if(null!==c)for(let q=c.length-1;0<=q;q--)n=c[q].C(a,g,n);const p=olympe.Y.Nc();af(e,b,(q,r)=>{g.register(p,null);const t=f.C(q,b,p,null);n(q,r,p,Fl(t,q,b,p))},p);a.onDestroy(()=>{Ze(e,b,p)});e.Ia(b)||Al(g)}
925
+ function jm(a,b,c){const d=c.getContext(),e=olympe.dc.ia(),f=a.G(),g=vg(e,b,a.K,d.G(h=>{null!==h&&(h=f(h));null===h?c.clear():c.update(h)}));d.onDestroy(()=>wg(e,b,a.K,g))}
926
+ olympe.dc.Za.Zh=class{constructor(a,b,c){this.K=a&&a.X?a.X():a;this.da=b&&b.filter(d=>d instanceof olympe.dc.da.Re||d instanceof olympe.dc.da.ye)||null;this.F=c||null;this.defaultValue=null}na(){}Nb(){}G(){}C(){return(this.da||[]).reduce((a,b)=>a.concat(olympe.dc.query.Relation.from(b)),[])}$g(a){this.defaultValue=a;return this}Tg(){return this.da}Ud(){return this.F}getValue(a,b){const c=a.run(()=>olympe.D.ic(this.Nb()||Object,'AbstractProperty valueType'));null!==this.defaultValue&&Ub(c,this.defaultValue);
927
+ b=this.F||b;null!==this.da?im(a,b,this.da,d=>{jm(this,d,c)}):jm(this,b,c);return c.tb()}ha(a){const b=Il(a,this.K),c=Il(a,this.F);let d='null';this.da&&(d=this.da.map(function(e){return e.ha(a)}).join(','));return`{"c":"${this.na()}","a":["${b}",${d},${c}]}`}toString(){const a=Hl(this.K),b=this.F?','+Hl(this.F):'';let c='';this.da&&(c=','+this.da.join(','));return this.na().replace(/^.+\./,'')+'('+a+c+b+')'}};olympe.dc.Za.Zh.ya=[olympe.dc.hk];olympe.dc.Za.An=class{constructor(a,b){if(olympe.D.bf(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.Rg(e,olympe.dc.CloudObject.extendRel,olympe.dm.xe);d=null;switch(1<a.length?a[a.length-2]:e){case olympe.dm.String.P.X():d=new olympe.dc.Za.Ei(c,b);break;case olympe.dm.Number.P.X():d=new olympe.dc.Za.xi(c,
928
+ b);break;case olympe.dm.Boolean.P.X():d=new olympe.dc.Za.mj(c,b);break;case olympe.dm.DateTime.P.X():d=new olympe.dc.Za.di(c,b)}this.F=d}na(){return this.F.na()}C(){return this.F.C()}getValue(a,b){return this.F.getValue(a,b)}ha(a){return this.F.ha(a)}toString(){return this.F.toString()}};olympe.dc.Za.An.ya=[olympe.dc.hk];olympe.dc.Za.mj=class extends olympe.dc.Za.Zh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.mj)}G(){return olympe.dc.nb.Em}Nb(){return olympe.D.fa}};R('olympe.dc.valuedefs.BooleanProperty',olympe.dc.Za.mj);olympe.dc.Za.Le=class{constructor(a){this.value=a}na(){return S(olympe.dc.Za.Le)}C(){return[]}getValue(){return this.value}ha(a){a=Il(a,this.value);return`{"c":"${this.na()}","a":[${a}]}`}toString(){return`Constant(${Hl(this.value)})`}};R('olympe.dc.valuedefs.Constant',olympe.dc.Za.Le);olympe.dc.Za.Le.ya=[olympe.dc.hk];olympe.dc.Za.di=class extends olympe.dc.Za.Zh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.di)}G(){return olympe.dc.nb.Fm}Nb(){return olympe.D.fb}};R('olympe.dc.valuedefs.DateTimeProperty',olympe.dc.Za.di);olympe.dc.Za.xi=class extends olympe.dc.Za.Zh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.xi)}G(){return olympe.dc.nb.Gm}Nb(){return olympe.D.ba}};R('olympe.dc.valuedefs.NumberProperty',olympe.dc.Za.xi);olympe.dc.Za.Ei=class extends olympe.dc.Za.Zh{constructor(a,b,c){super(a,b,c)}na(){return S(olympe.dc.Za.Ei)}G(){return olympe.dc.nb.Hm}Nb(){return olympe.D.Oa}};R('olympe.dc.valuedefs.StringProperty',olympe.dc.Za.Ei);olympe.dc.Za.Gi=class{na(){return S(olympe.dc.Za.Gi)}C(){return[]}getValue(a,b){return b}ha(){return'{"c":"'+this.na()+'","a":[]}'}toString(){return'Tag()'}};R('olympe.dc.valuedefs.Tag',olympe.dc.Za.Gi);olympe.dc.Za.Gi.ya=[olympe.dc.hk];olympe.dc.da={};olympe.dc.da.ei=class{Nb(){return null}na(){return S(olympe.dc.da.ei)}C(a,b,c){const d={};return function(e,f,g,h){e?void 0===d[f]?(d[f]=1,b.C.C!==g||b.F||(b.C.C=f),c(!0,f,f,Fl(h,!0,f,f))):(d[f]++,am(b,g)):void 0!==d[f]&&0>=--d[f]&&(delete d[f],c(!1,f,f,Fl(h,!1,f,f)))}}ha(){return'{"c":"'+this.na()+'"}'}toString(){return'Distinct()'}};R('olympe.dc.transformers.Distinct',olympe.dc.da.ei);olympe.dc.da.ei.ya=[olympe.dc.uf];olympe.dc.da.jf=class{constructor(a){this.F=a}Nb(){return null}na(){return S(olympe.dc.da.jf)}G(){return this.F.F()}C(a,b,c){function d(f,g,h,k){k=k.valueOf();!1===k&&am(b,g);k!==!!e[g]&&(e[g]=k,c(k,f,g,Fl(h,k,f,g)))}const e={};return(f,g,h,k)=>{const l='@'+h;if(f){let n=this.F.C(a,g);olympe.D.ib(n)&&(n=n.Da);olympe.D.Gf(n)?(b.F||void 0!==olympe.D.Ma(n)||am(b,h),e[l]=n,a.run(()=>{olympe.D.Oc([n],p=>{d(g,h,k,p)},'filterResultHandler')})):d(g,h,k,n)}else void 0!==e[l]&&(e[l].destroy(),delete e[l]),
929
+ d(g,h,k,!1),delete e[h]}}ha(a){return'{"c":"'+this.na()+'","a":['+this.F.ha(a)+']}'}toString(){return'Filter('+this.F.toString()+')'}};R('olympe.dc.transformers.Filter',olympe.dc.da.jf);olympe.dc.da.jf.ya=[olympe.dc.uf,olympe.dc.oq];olympe.dc.da.rl=class{constructor(a,b,c,d){this.F=new olympe.dc.Na.Relation(olympe.dc.ga(a),c||olympe.dc.wa.DESTINATION);this.G=new olympe.dc.Na.Relation(olympe.dc.ga(b),d||olympe.dc.wa.DESTINATION)}Nb(){return yf(this.F)}na(){return S(olympe.dc.da.rl)}C(a,b,c){const d=olympe.dc.ia(),e={},f=this.F.X(),g=this.F.Ja(),h=this.G.X(),k=this.G.Ja();let l=null,n=null;const p=(r,t,u,x,y,z)=>{if(y){if(y=()=>{const A=olympe.Y.xb(u+g+(f+'_'+r)+z,20),B=Fl(t,!0,z,A);l=r;n=()=>{c(!1,z,A,Fl(t,!1,z,A))};b.register(A,
930
+ u,x,f,g);c(!0,z,A,B)},y.Wr=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 B=Object.keys(e),O=B.length,M=0;M<O;M++){let xa=e[B[M]];xa.Wr<y&&(y=xa.Wr,A=xa)}A&&A()}},q=(r,t,u,x,y)=>{x?e[y]||(e[y]=!0,bm(b,u,y,f,g),bm(b,u,y,h,k),V(d,y,this.F,p.bind(this,r,t,u,y),u+'_val'),V(d,y,this.G,q.bind(this,r+1,t,u),u+'_follow')):(d.F(y,this.G,u+'_follow'),d.F(y,this.F,u+'_val'),delete e[y])};return(r,t,u,x)=>q(0,x,u,r,t)}ha(){return'{"c":"'+this.na()+'","a":["'+this.F.toString()+
931
+ '","'+this.G.toString()+'"]}'}toString(){return'FirstRelated('+this.F.toString()+', '+this.G.toString()+')'}};R('olympe.dc.transformers.FirstRelated',olympe.dc.da.rl);olympe.dc.da.rl.ya=[olympe.dc.uf];olympe.dc.da.oh=class{constructor(a,b){this.start=a;this.F=b}Nb(){return null}na(){return S(olympe.dc.da.oh)}C(a,b,c){const d=new olympe.dc.lc.Jl;let e,f,g,h=!1;const k=()=>{if(void 0!==f&&void 0!==g&&void 0!==e){var n=f+g;b.F||(b.C.C=e[0>n-1?0:Math.min(e.length,n)-1]);Tl(d,e,f,n,c)}};a.run(()=>olympe.D.Oc([this.start,this.F],(n,p)=>{f=n.valueOf();g=p.valueOf();k()}));gm(b,k);const l=dm(b);cm(b,l);return(n,p,q,r)=>{h||(r.ke().fg(t=>{e=t;hm(b,l)}),Dl(b,()=>r.Yf(),l),h=!0);d.C(n,p,q,null);El(b,q,l)}}ha(a){return'{"c":"'+
932
+ this.na()+'","a":['+Il(a,this.start)+','+Il(a,this.F)+']}'}toString(){return`Limit(${olympe.D.Ma(this.start)},${olympe.D.Ma(this.F)})`}};R('olympe.dc.transformers.Limit',olympe.dc.da.oh);olympe.dc.da.oh.ya=[olympe.dc.uf];function km(a){return a.pb.map(b=>b.X())}
933
+ olympe.dc.da.Gj=class{constructor(a,b){this.direction=b||olympe.dc.wa.DESTINATION;this.pb=a.map(c=>new olympe.dc.Na.Relation(c,this.direction))}Nb(){return olympe.dc.CloudObject}na(){return S(olympe.dc.da.Gj)}Ja(){return this.direction}C(a,b,c){const d=olympe.dc.ia(),e=(f,g,h,k)=>V(d,f,k,(l,n)=>{var p=k.X();p=olympe.Y.xb(g+k.Ja()+p+n,20);const q=Fl(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.pb.forEach(l=>{bm(b,h,g,l.X(),l.Ja());e(g,h,k,l)}):this.pb.forEach(l=>
934
+ {d.F(g,l,h)})}}ha(){return'{"c":"'+this.na()+'","a":['+JSON.stringify(km(this))+',"'+this.direction+'"]}'}toString(){return'MultiRelated('+this.Ja()+'['+km(this).join(',')+'])'}};R('olympe.dc.transformers.MultiRelated',olympe.dc.da.Gj);olympe.dc.da.Gj.ya=[olympe.dc.uf];olympe.dc.da.ye=class extends olympe.dc.Na.Relation{constructor(a,b=olympe.dc.wa.DESTINATION,c=1,d=-1){super(a,b);this.G=c;this.F=d}Nb(){return yf(this)}na(){return S(olympe.dc.da.ye)}C(a,b,c){const d=olympe.dc.ia(),e=Object.create(null),f=olympe.dc.wa.ORIGIN,g=olympe.dc.wa.DESTINATION,h=this.X(),k=this.Ja(),l=(p,q,r)=>{if(!(0<=this.F&&p>=this.F)){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.Y.xb(q+k+(h+'_'+p)+t[u],20);b.register(y,
935
+ q,r,h,k||g);null===k&&b.register(y,q,r,h,f)}}},n=(p,q,r,t,u,x)=>{u&&!b.F&&l(p,t,x);p>=this.G?c(u,x,t,Fl(r,u,x,t)):bm(b,t,x,h,k);0<=this.F&&p>=this.F||(u?e[x]||(e[x]=!0,V(d,x,this,(y,z)=>{const A=p+1,B=olympe.Y.xb(t+k+(h+'_'+A)+z,20);n(A,x,r,B,y,z)},t)):(d.F(x,this,t),delete e[x]))};return(p,q,r,t)=>n(0,null,t,r,p,q)}ha(){return'{"c":"'+this.na()+'","a":["'+this.X()+'","'+this.Ja()+'",'+this.G+','+this.F+']}'}toString(){return'RecursiveRelated('+this.Ja()+this.X()+'['+this.G+'..'+this.F+'])'}};
936
+ R('olympe.dc.transformers.RecursiveRelated',olympe.dc.da.ye);olympe.dc.da.ye.ya=[olympe.dc.uf];olympe.dc.da.Re=class extends olympe.dc.Na.Relation{constructor(a,b){super(a,b||olympe.dc.wa.DESTINATION)}Nb(){return yf(this)}na(){return S(olympe.dc.da.Re)}cc(){return new olympe.dc.da.Re(this.tag,this.direction===olympe.dc.wa.DESTINATION?olympe.dc.wa.ORIGIN:olympe.dc.wa.DESTINATION)}C(a,b,c){const d=olympe.dc.ia(),e=this.X(),f=this.Ja();return(g,h,k,l)=>{bm(b,k,h,e,f);g?V(d,h,this,(n,p)=>{const q=olympe.Y.xb(k+f+e+p,20),r=Fl(l,n,p,q);n&&b.register(q,k,h,e,f);c(n,p,q,r)},k):d.F(h,this,k)}}ha(){return'{"c":"'+
937
+ this.na()+'","a":["'+this.X()+'","'+this.Ja()+'"]}'}toString(){return'Related('+this.Ja()+this.X()+')'}};R('olympe.dc.transformers.Related',olympe.dc.da.Re);olympe.dc.da.Re.ya=[olympe.dc.uf];olympe.dc.da.Gg=class{constructor(a,b){this.Gb=a;this.F=void 0===b?!0:!!b}Nb(){return null}na(){return S(olympe.dc.da.Gg)}Ng(){return this.Gb}G(){return[this.Gb.K()]}C(a,b,c){const d=new olympe.dc.lc.Zq(a.G(this.F?this.Gb.compare.bind(this.Gb):(e,f)=>this.Gb.compare(f,e)));return(e,f,g)=>{var h=e?this.Gb.G(a,f):void 0;h=d.C(e,f,g,h);c(e,f,g,h)}}ha(a){return'{"c":"'+this.na()+'","a":['+this.Gb.ha(a)+','+JSON.stringify(this.F)+']}'}toString(){return'Sort('+this.Gb.toString()+','+JSON.stringify(this.F)+
938
+ ')'}};R('olympe.dc.transformers.Sort',olympe.dc.da.Gg);olympe.dc.da.Gg.ya=[olympe.dc.uf,olympe.dc.oq];function lm(a,b,c,d,e,f){function g(n,p){if(l)for(var q=l.length-1;0<=q;q--)f=l[q].C(b,e,f);e.register(h,null);q=d.C(n,p,c,null);f(n,p,h,Fl(q,n,p,h))}const h=olympe.Y.Nc(),k=olympe.dc.ia(),l=a.da;b.run(()=>olympe.D.Oc([a.F],n=>{mm(k,n,g,h);void 0===k.model(n)&&Al(e)}))}function mm(a,b,c,d){const e=b&&b.valueOf();e&&(af(a,e,c,d),olympe.D.$a().Z(()=>Ze(a,e,d)))}
939
+ olympe.dc.da.vf=class{constructor(a,b){this.da=this.F=null;a instanceof olympe.dc.za?(this.F=a.Ud(),this.da=a.El()):(this.F=a,b&&(this.da=b))}Nb(){return null}na(){return S(olympe.dc.da.vf)||''}Tg(){return this.da}Ud(){return this.F}C(a,b,c){const d=new olympe.dc.lc.Jl,e=new olympe.dc.lc.lj;let f=[],g=[],h=!1,k=!1;const l=dm(b),n=dm(b);gm(b,()=>{const p=f.concat(g);0<p.length?b.F||(b.C.C=p[p.length-1]):hm(b);Tl(d,p,0,p.length,c)});cm(b,n);lm(this,a,this.F,e,b,(p,q,r,t)=>{const u=olympe.D.$a();u.od()||
940
+ u.eb()||(k||(t.ke().fg(x=>{g=x;hm(b,n)}),Dl(b,()=>t.Yf(),n),k=!0),d.C(p,q,r),El(b,r,n))});cm(b,l);return(p,q,r,t)=>{h||(t.ke().fg(u=>{f=u;hm(b,l)}),Dl(b,()=>t.Yf(),l),h=!0);d.C(p,q,r,l);El(b,r,l)}}ha(a){const b=this.da?'['+this.da.map(c=>c.ha(a)).join(',')+']':'null';return'{"c":"'+this.na()+'","a":['+Il(a,this.F)+','+b+']}'}toString(){const a=olympe.D.ib(this.F)?'N:'+this.F.Da.V():this.F.valueOf(),b=this.da?','+this.da.map(c=>c.toString()).join(','):'';return'Union('+a+b+')'}};
941
+ R('olympe.dc.transformers.Union',olympe.dc.da.vf);olympe.dc.da.vf.ya=[olympe.dc.uf];olympe.dc.da.Gq={kA:1,wt:-1,vt:0};olympe.dc.da.MB={Sy:!0,sz:!1};olympe.dc.kc.R={Bp:'dc.legacy.listdefProcessor'};olympe.dc.kc.U={Ap:'dc.legacy.listdefsCovered'};olympe.W.config(a=>{F(a,olympe.dc.kc.U.Ap,!1);D(a,olympe.dc.kc.R.Bp,olympe.dc.kc.lu,olympe.dc.query.R.Ca,olympe.dc.R.gh,olympe.dc.transaction.R.Ea,olympe.dc.query.R.Qj,new olympe.W.ja(olympe.dc.U.Ah),new olympe.W.ja(olympe.dc.kc.U.Ap))});olympe.W.run([olympe.dc.kc.R.Bp],a=>{olympe.dc.kc.Zw=()=>a});function nm(a){const b=olympe.dc.ia(),c=new Map;b.Mr(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}
942
+ olympe.dc.CloudObject=class{constructor(a,b){this.tag=b;this.db=olympe.dc.ia();this.model=null}static Vc(a,b,c,...d){b=olympe.dc.ga(b);var e=cf(b);(e=e&&e.C)?e(a,c,...d):(a=a.create(b),void 0!==c&&null!==c&&Z(a,olympe.dc.CloudObject.nameProp,c),a.X())}static get(a){if(a instanceof olympe.dc.CloudObject)var b=a;else{b=olympe.dc.Pr();a=olympe.dc.ga(a);var c=b.db.model(a);c=bf(b,c);if(null===c)throw new olympe.dc.aq(a);c=c.instantiate(a,b.F);b.C.C.kb([a]);b.Na.register(c,a);b=c}return b}static exists(a){return olympe.dc.ia().Ia(olympe.dc.ga(a))}static gw(a,
943
+ b,c){const d=olympe.dc.ia();let e=null;const f=k=>{null===e&&(e=nm(b||this));return e.has(k)?e.get(k):null},g=cl(!1),h=g.create(null!=b?b:this);void 0!==c&&h.Vh(c);a.forEach((k,l)=>{d.Ia(olympe.dc.ga(l))?Z(h,l,k):(l=f(l))&&Z(h,l,k)});g.ob((k,l)=>{k||olympe.ma.hb('dc').error(`Error occurred for transaction executed by CloudObject.createWith: ${l}`)});return this.get(h)}static Yv(){return this.get(this)}static Bk(a){return olympe.dc.pa.Bk(a)}static Cb(){return olympe.dc.ia().bb(this,olympe.dc.CloudObject.propertyRel).map(a=>
944
+ new olympe.dc.Na.Property(a))}static xd(){const a=olympe.dc.ia();return a.bb(this,olympe.dc.CloudObject.cj).map(b=>new olympe.dc.Na.Relation(b)).concat(a.bb(this,olympe.dc.CloudObject.Er).map(b=>new olympe.dc.Na.Relation(b,olympe.dc.wa.ORIGIN)))}static Mc(a){return olympe.dc.CloudObject.get(a)}static Qr(a){var b=bf(olympe.dc.Pr(),olympe.dc.ga(a));b=b&&b.F;return new olympe.dc.za(olympe.dc.ga(a),olympe.dc.CloudObject.instancesRel,b)}X(){return this.tag}name(){return this.db.name(this)}na(){return this.wb(olympe.dc.CloudObject.nameProp)}Wb(){this.model||
945
+ (this.model=olympe.dc.CloudObject.get(this.db.model(this)));return this.model}query(){return olympe.dc.pa.from(this)}Hf(){return this.db.Hf(this)}sb(){return this.db.source(this)}Ww(){return this.db.Th(this)?olympe.dc.Xd().fromModel(this):null}Lr(){return olympe.D.va([this.na()],a=>olympe.D.Ab(a),olympe.D.Oa,'getDisplayName',olympe.D.Ab('('+this.toString()+')'))}ec(){return this.model?this.model.X():this.db.model(this)}observe(a,b,c=!0){const d='function'===typeof a.F?a.F():a;return new rxjs.Observable(e=>
946
+ {const f=olympe.dc.nb.Ac(this.db.Ra(this.tag,b));c||null!==f||e.next(f);const g=vg(this.db,this.tag,b,h=>{e.next(olympe.dc.nb.Ac(h))});d.Z(()=>{e.complete();wg(this.db,this.tag,b,g)});return()=>wg(this.db,this.tag,b,g)})}hy(a){const b='function'===typeof a.F?a.F():a;return new rxjs.Observable(c=>{const d=xg(this.db,this.tag,(e,f)=>{null===f||void 0===f?c.next([new olympe.dc.Na.Property(e),null]):c.next([new olympe.dc.Na.Property(e),f])});b.Z(()=>{c.complete();yg(this.db,this.tag,d)});return()=>yg(this.db,
947
+ this.tag,d)})}iy(a){return this.observe(olympe.D.$a(),a)}get(a){return olympe.dc.nb.Ac(this.db.Ra(this.tag,a))}Ra(a){return this.get(a)}gb(a){return olympe.dc.pa.from(this).gb(a)}pk(a){return olympe.dc.hd.from(this).gb(a)}Ac(){return this}Gw(){return this.qc(olympe.dc.CloudObject.cw,olympe.dc.CloudObject)}Pm(){return this.bb(olympe.dc.CloudObject.containsRel,olympe.dc.CloudObject)}Ef(a,b,c){const d=olympe.D.ic(c,'Sync valueType'),e=vg(this.db,this.tag,a,olympe.D.$a().G(f=>{b&&null!==f&&void 0!==f&&
948
+ (f=b(f));null===f||void 0===f?d.clear():d.update(f)}));d.getContext().onDestroy(()=>wg(this.db,this.tag,a,e));return d.getContext()}wb(a){return L(this.Ef(a,olympe.dc.nb.Hm,olympe.D.Oa))}cd(a){return L(this.Ef(a,olympe.dc.nb.Gm,olympe.D.ba))}Qg(a){return L(this.Ef(a,olympe.dc.nb.Em,olympe.D.fa))}Xi(a){return L(this.Ef(a,olympe.dc.nb.Fm,olympe.D.fb))}Ur(){return L(this.Ef(olympe.dm.Color.valueProp,olympe.dc.nb.xr,olympe.D.Color))}Vr(){return L(this.Ef(olympe.sc.workflow.Transition.processRefProp,olympe.dc.nb.yr,
949
+ olympe.dc.CloudObject))}bb(a,b){a=a instanceof olympe.dc.da.Re?a:new olympe.dc.da.Re(a.X(),a.Ja());return new olympe.dc.za(this.X(),a,b)}qc(a,b){return this.bb(a,b).Gc()}Hr(a,b){const c=this.db,d=olympe.Y.Nc(),e=olympe.D.$a(),f=new Map;V(c,this.tag,a,(g,h)=>{if(g)(g=e.run(b,olympe.dc.CloudObject.get(h)))&&f.set(h,g);else{let k;null==(k=f.get(h))||k();f.delete(h)}},d);e.onDestroy(()=>{c.F(this.tag,a,d)})}Ly(){return new olympe.dc.za(this.X(),[],wf(this.X()))}transform(...a){return(new olympe.dc.za(this.X(),
950
+ [],this.constructor)).transform(...a)}Pc(){return this.Lr()}toString(){return`CloudObject: ${JSON.stringify(this)}`}toJSON(){return this.db.Ia(this.tag)?Object.assign({'#tag':this.X(),'#type':this.Wb().name()},this.Qc(!0,!0)):{'#tag':this.X(),'#error':'The object does not exist in the local database.'}}Qc(a=!1,b=!0){const c={};this.db.Cb(this,b).forEach((d,e)=>{this.db.Ia(e)&&(e=a?this.db.name(e):e,c[e]=olympe.dc.nb.Ac(d))});return c}Ga(a){return a instanceof olympe.dc.CloudObject?this.X()===a.X():
951
+ 'function'===typeof a?olympe.dc.oa.ec(a)===this.X():!1}Ad(a){return olympe.D.va([a],b=>olympe.D.Xb(this.Ga(b)),olympe.D.fa)}jw(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.wa.ORIGIN;for(const [e,f,g]of Ig(b,this))f===d?a.jc(e,g,this):e!==olympe.dc.CloudObject.modelRel.X()&&a.jc(e,this,g);a.delete(this,olympe.dc.Ob.NONE);c&&a.ob()}};olympe.dc.CloudObject.prototype.equals=olympe.dc.CloudObject.prototype.Ga;olympe.dc.CloudObject.prototype.toObject=olympe.dc.CloudObject.prototype.Qc;
952
+ olympe.dc.CloudObject.prototype.followSingle=olympe.dc.CloudObject.prototype.pk;olympe.dc.CloudObject.prototype.follow=olympe.dc.CloudObject.prototype.gb;olympe.dc.CloudObject.prototype.getProperty=olympe.dc.CloudObject.prototype.Ra;olympe.dc.CloudObject.prototype.get=olympe.dc.CloudObject.prototype.get;olympe.dc.CloudObject.prototype.observeProperty=olympe.dc.CloudObject.prototype.iy;olympe.dc.CloudObject.prototype.observeProperties=olympe.dc.CloudObject.prototype.hy;
953
+ olympe.dc.CloudObject.prototype.observe=olympe.dc.CloudObject.prototype.observe;olympe.dc.CloudObject.prototype.getModelTag=olympe.dc.CloudObject.prototype.ec;olympe.dc.CloudObject.prototype.getSource=olympe.dc.CloudObject.prototype.sb;olympe.dc.CloudObject.prototype.isPersisted=olympe.dc.CloudObject.prototype.Hf;olympe.dc.CloudObject.prototype.query=olympe.dc.CloudObject.prototype.query;olympe.dc.CloudObject.prototype.getModel=olympe.dc.CloudObject.prototype.Wb;
954
+ 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.Qr;olympe.dc.CloudObject.getInstance=olympe.dc.CloudObject.Mc;olympe.dc.CloudObject.getRelations=olympe.dc.CloudObject.xd;olympe.dc.CloudObject.getProperties=olympe.dc.CloudObject.Cb;olympe.dc.CloudObject.instancesOf=olympe.dc.CloudObject.Bk;olympe.dc.CloudObject.asInstance=olympe.dc.CloudObject.Yv;
955
+ olympe.dc.CloudObject.createWith=olympe.dc.CloudObject.gw;olympe.dc.CloudObject.exists=olympe.dc.CloudObject.exists;olympe.dc.CloudObject.get=olympe.dc.CloudObject.get;olympe.dc.CloudObject.P=olympe.dc.oa.C('ff021000000000000001',olympe.dc.CloudObject);olympe.dc.CloudObject.WD=olympe.dc.CloudObject.P.la(olympe.dc.tp.VERSION);olympe.dc.CloudObject.nameProp=olympe.dc.CloudObject.P.la('ff023000000000000011');w('olympe.dc.CloudObject.nameProp',olympe.dc.CloudObject.nameProp);
956
+ olympe.dc.CloudObject.HD=olympe.dc.CloudObject.P.la('ff023000000000000012');olympe.dc.CloudObject.cj=olympe.dc.CloudObject.P.ra('ff02200000000000000a');olympe.dc.CloudObject.Er=olympe.dc.CloudObject.P.ra('ff02200000000000000b',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.qD=olympe.dc.CloudObject.P.ra('017e9c4ba4c847d71cbf');olympe.dc.CloudObject.hD=olympe.dc.CloudObject.P.ra('017ea013caf8e89cedb2');olympe.dc.CloudObject.propertyRel=olympe.dc.CloudObject.P.ra('ff02200000000000000c');
955
957
  w('olympe.dc.CloudObject.propertyRel',olympe.dc.CloudObject.propertyRel);olympe.dc.CloudObject.typeRel=olympe.dc.CloudObject.P.ra('ff02200000000000000d',olympe.dc.wa.ORIGIN);olympe.dc.CloudObject.modelRel=olympe.dc.CloudObject.P.ra(olympe.dc.nc.Zc);w('olympe.dc.CloudObject.modelRel',olympe.dc.CloudObject.modelRel);olympe.dc.CloudObject.instancesRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.modelRel);w('olympe.dc.CloudObject.instancesRel',olympe.dc.CloudObject.instancesRel);
956
- olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.ra(olympe.dc.nc.ei);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.ra(olympe.dc.nc.pj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
957
- olympe.dc.CloudObject.bw=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.hw=olympe.dc.CloudObject.P.ra('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.hw);olympe.dc.NB=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ne];m=olympe.dc.CloudObject.prototype;m.X.L=new olympe.D.K(()=>String,[]);m.name.L=new olympe.D.K(()=>String,[]);m.na.L=olympe.D.K.F;m.Wb.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
958
- m.sb.L=new olympe.D.K(()=>String,[]);m.Vw.L=new olympe.D.K(()=>String,[]);m.Kr.L=olympe.D.K.F;m.ec.L=new olympe.D.K(()=>String,[]);m.Fw.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Pm.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Df.L=new olympe.D.K(()=>olympe.D.Node,[]);m.wb.L=olympe.D.K.F;m.cd.L=olympe.D.K.G;m.Qg.L=olympe.D.K.O;m.Xi.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Tr.L=new olympe.D.K(()=>olympe.D.Color,[]);m.Ur.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
959
- m.bb.L=new olympe.D.K(()=>olympe.dc.za,[]);m.qc.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Gr.L=new olympe.D.K(()=>Function,[]);m.Ky.L=new olympe.D.K(()=>olympe.dc.za,[]);m.transform.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Oc.L=olympe.D.K.F;m.toString.L=olympe.D.K.C;m.Ga.L=olympe.D.K.C;m.Ad.L=olympe.D.K.O;m.iw.L=new olympe.D.K(()=>{},[]);olympe.dc.R={gh:'dc.DBView',op:'dc.InstanceManager',Ca:'dc.Logger',uv:'dc.TransactionLogger',wj:'dc.FileServiceManager',Ag:'dc.Router'};olympe.dc.U={Dg:'dc.tag',Mf:'dc.debug',zh:'dc.subscribeAll',ll:'dc.defaultSource',Jo:'dc.fileCache',ko:'dc.dataConsumerOnly',Eo:'dc.errorOnAbstractInstantiation'};
960
- olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Mf,!1);F(a,olympe.dc.U.zh,!1);F(a,olympe.dc.U.ll,olympe.dc.Qa.SERVER);F(a,olympe.dc.U.ko,b);F(a,olympe.dc.U.Jo,b);F(a,olympe.dc.U.Eo,!0);F(a,olympe.dc.U.Dg,olympe.Y.Mc());E(a,olympe.dc.R.Ca,[olympe.ma.R.Ea],c=>c.Wc('dc'));La(a,olympe.dc.R.uv,olympe.dc.transaction.R.Ca);La(a,olympe.dc.R.gh,olympe.dc.db.R.il);D(a,olympe.dc.R.wj,olympe.dc.it,olympe.dc.R.Ca,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.dc.R.Ag,olympe.Y.R.jg,new olympe.W.ja(olympe.dc.U.Jo));
961
- D(a,olympe.dc.R.Ag,olympe.dc.Wu,olympe.dc.R.Ca,olympe.dc.sources.R.yq,olympe.dc.sources.R.Oq,olympe.dc.R.gh,olympe.host.R.Qe,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.U.ko));D(a,olympe.dc.R.op,olympe.dc.Ct,olympe.dc.db.R.sl,olympe.dc.db.R.Ea,olympe.W.R.kg)},'olympe.dc');
962
- olympe.W.run([olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.op,olympe.dc.R.wj,new olympe.W.ja(olympe.dc.U.Dg)],(a,b,c,d,e)=>{olympe.dc.Ir=()=>a;olympe.dc.Yi=()=>b;olympe.dc.Nr=()=>c;olympe.dc.Mr=()=>d;olympe.dc.Qa.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Ld=class extends olympe.dc.CloudObject{na(){return this.wb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Oa.EMPTY}F(){return olympe.D.fa.C}};olympe.dm.Ld.P=olympe.dc.oa.C('ff021000000000000002',olympe.dm.Ld);olympe.dm.Ld.O=olympe.dm.Ld.P.la('ff023000000000000035');olympe.dm.Ld.C=olympe.dm.Ld.P.ra('ff022000000000000005');olympe.dm.Ld.G=vf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ld.J=vf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
963
- olympe.dm.Ld.F=vf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ld.prototype.na.L=olympe.D.K.F;olympe.dm.Ld.prototype.C.L=olympe.D.K.F;olympe.dm.Ld.prototype.F.L=olympe.D.K.O;olympe.dm.Ok={NONE:0,wz:1,Vs:2,xz:4,sz:8,vz:16,uz:31,TA:32,QA:64,UA:128,RA:256,Au:512,SA:992,kA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Sw(){return this.Sm()}na(){return this.Sm()}Sm(){return this.wb(olympe.dm.User.loginProp)}Pt(){return this.wb(olympe.dm.User.F)}Ot(){return olympe.D.Oa.EMPTY}px(){return this.wb(olympe.dm.User.saltProp)}zx(){return this.wb(olympe.dm.User.verifierProp)}nx(){return this.bb(olympe.dm.User.G,olympe.dm.Ld)}};olympe.dm.User.P=olympe.dc.oa.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.la('ff023000000000000001');
958
+ olympe.dc.CloudObject.extendRel=olympe.dc.CloudObject.P.ra(olympe.dc.nc.fi);w('olympe.dc.CloudObject.extendRel',olympe.dc.CloudObject.extendRel);olympe.dc.CloudObject.extendedByRel=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.extendRel);w('olympe.dc.CloudObject.extendedByRel',olympe.dc.CloudObject.extendedByRel);olympe.dc.CloudObject.containsRel=olympe.dc.CloudObject.P.ra(olympe.dc.nc.pj);w('olympe.dc.CloudObject.containsRel',olympe.dc.CloudObject.containsRel);
959
+ olympe.dc.CloudObject.cw=T(olympe.dc.CloudObject.P,olympe.dc.CloudObject.containsRel);olympe.dc.CloudObject.iw=olympe.dc.CloudObject.P.ra('018282d3ac0a474a0bf4');w('olympe.dc.CloudObject.deleteAlsoRel',olympe.dc.CloudObject.iw);olympe.dc.OB=olympe.dc.CloudObject;olympe.dc.CloudObject.ya=[olympe.dc.Ne];m=olympe.dc.CloudObject.prototype;m.X.L=new olympe.D.J(()=>String,[]);m.name.L=new olympe.D.J(()=>String,[]);m.na.L=olympe.D.J.F;m.Wb.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
960
+ m.sb.L=new olympe.D.J(()=>String,[]);m.Ww.L=new olympe.D.J(()=>String,[]);m.Lr.L=olympe.D.J.F;m.ec.L=new olympe.D.J(()=>String,[]);m.Gw.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Pm.L=new olympe.D.J(()=>olympe.dc.za,[]);m.Ef.L=new olympe.D.J(()=>olympe.D.Node,[]);m.wb.L=olympe.D.J.F;m.cd.L=olympe.D.J.G;m.Qg.L=olympe.D.J.O;m.Xi.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Ur.L=new olympe.D.J(()=>olympe.D.Color,[]);m.Vr.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
961
+ m.bb.L=new olympe.D.J(()=>olympe.dc.za,[]);m.qc.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Hr.L=new olympe.D.J(()=>Function,[]);m.Ly.L=new olympe.D.J(()=>olympe.dc.za,[]);m.transform.L=new olympe.D.J(()=>olympe.dc.za,[]);m.Pc.L=olympe.D.J.F;m.toString.L=olympe.D.J.C;m.Ga.L=olympe.D.J.C;m.Ad.L=olympe.D.J.O;m.jw.L=new olympe.D.J(()=>{},[]);olympe.dc.R={gh:'dc.DBView',pp:'dc.InstanceManager',Ca:'dc.Logger',vv:'dc.TransactionLogger',wj:'dc.FileServiceManager',Ag:'dc.Router'};olympe.dc.U={Dg:'dc.tag',Nf:'dc.debug',Ah:'dc.subscribeAll',ll:'dc.defaultSource',Jo:'dc.fileCache',ko:'dc.dataConsumerOnly',Eo:'dc.errorOnAbstractInstantiation'};
962
+ olympe.W.config(function(a){const b='object'===typeof window;F(a,olympe.dc.U.Nf,!1);F(a,olympe.dc.U.Ah,!1);F(a,olympe.dc.U.ll,olympe.dc.Qa.SERVER);F(a,olympe.dc.U.ko,b);F(a,olympe.dc.U.Jo,b);F(a,olympe.dc.U.Eo,!0);F(a,olympe.dc.U.Dg,olympe.Y.Nc());E(a,olympe.dc.R.Ca,[olympe.ma.R.Ea],c=>c.Wc('dc'));La(a,olympe.dc.R.vv,olympe.dc.transaction.R.Ca);La(a,olympe.dc.R.gh,olympe.dc.db.R.il);D(a,olympe.dc.R.wj,olympe.dc.jt,olympe.dc.R.Ca,olympe.dc.db.R.Ea,olympe.net.R.Ea,olympe.dc.R.Ag,olympe.Y.R.jg,new olympe.W.ja(olympe.dc.U.Jo));
963
+ D(a,olympe.dc.R.Ag,olympe.dc.Xu,olympe.dc.R.Ca,olympe.dc.sources.R.zq,olympe.dc.sources.R.Pq,olympe.dc.R.gh,olympe.host.R.Qe,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.U.ko));D(a,olympe.dc.R.pp,olympe.dc.Dt,olympe.dc.db.R.sl,olympe.dc.db.R.Ea,olympe.W.R.kg)},'olympe.dc');
964
+ olympe.W.run([olympe.dc.db.R.Ea,olympe.dc.transaction.R.Ea,olympe.dc.R.pp,olympe.dc.R.wj,new olympe.W.ja(olympe.dc.U.Dg)],(a,b,c,d,e)=>{olympe.dc.Jr=()=>a;olympe.dc.Yi=()=>b;olympe.dc.Pr=()=>c;olympe.dc.Nr=()=>d;olympe.dc.Qa.SELF=e},'DC singleton getter initialization');olympe.dm={};olympe.dm.Ld=class extends olympe.dc.CloudObject{na(){return this.wb(olympe.dc.CloudObject.nameProp)}C(){return olympe.D.Oa.EMPTY}F(){return olympe.D.fa.C}};olympe.dm.Ld.P=olympe.dc.oa.C('ff021000000000000002',olympe.dm.Ld);olympe.dm.Ld.O=olympe.dm.Ld.P.la('ff023000000000000035');olympe.dm.Ld.C=olympe.dm.Ld.P.ra('ff022000000000000005');olympe.dm.Ld.G=vf('ff011000000000000001','AUTHENTICATED_USERS');olympe.dm.Ld.K=vf('ff011000000000000002','PROJECT_RUNNER_USERS_ROLE');
965
+ olympe.dm.Ld.F=vf('014831d95f83635090ea','ADMIN_USERS_ROLE');olympe.dm.Ld.prototype.na.L=olympe.D.J.F;olympe.dm.Ld.prototype.C.L=olympe.D.J.F;olympe.dm.Ld.prototype.F.L=olympe.D.J.O;olympe.dm.Ok={NONE:0,xz:1,Ws:2,yz:4,uz:8,wz:16,vz:31,UA:32,RA:64,VA:128,SA:256,Bu:512,TA:992,lA:1023};olympe.dm.User=class extends olympe.dc.CloudObject{Tw(){return this.Sm()}na(){return this.Sm()}Sm(){return this.wb(olympe.dm.User.loginProp)}Qt(){return this.wb(olympe.dm.User.F)}Pt(){return olympe.D.Oa.EMPTY}qx(){return this.wb(olympe.dm.User.saltProp)}Ax(){return this.wb(olympe.dm.User.verifierProp)}ox(){return this.bb(olympe.dm.User.G,olympe.dm.Ld)}};olympe.dm.User.P=olympe.dc.oa.C('ff021000000000000003',olympe.dm.User);olympe.dm.User.loginProp=olympe.dm.User.P.la('ff023000000000000001');
964
966
  w('olympe.dm.User.loginProp',olympe.dm.User.loginProp);olympe.dm.User.F=olympe.dm.User.P.la('ff023000000000000002');olympe.dm.User.T=olympe.dm.User.P.la('ff023000000000000003');olympe.dm.User.saltProp=olympe.dm.User.P.la('ff023000000000000004');w('olympe.dm.User.saltProp',olympe.dm.User.saltProp);olympe.dm.User.verifierProp=olympe.dm.User.P.la('ff023000000000000005');w('olympe.dm.User.verifierProp',olympe.dm.User.verifierProp);olympe.dm.User.O=olympe.dm.User.P.la('ff023000000000000020');
965
- olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.la('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=T(olympe.dm.User.P,olympe.dm.Ld.C);olympe.dm.User.Z=olympe.dm.User.P.ra('ff022000000000000002');olympe.dm.User.C=vf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.J=vf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Sw.L=olympe.D.K.F;m.na.L=olympe.D.K.F;m.Sm.L=olympe.D.K.F;m.Pt.L=olympe.D.K.F;m.Ot.L=olympe.D.K.F;m.px.L=olympe.D.K.F;
966
- m.zx.L=olympe.D.K.F;m.nx.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Pf=class extends olympe.dc.CloudObject{Z(){return this.Pm()}ab(){return this.wb(olympe.dm.Pf.ab)}};olympe.dm.Pf.P=olympe.dc.oa.C('01621fb84e3300000000',olympe.dm.Pf);olympe.dm.Pf.ab=olympe.dm.Pf.P.la('01609de3f292e3c2c6ff');olympe.dm.Pf.prototype.Z.L=new olympe.D.K(()=>olympe.D.ld,[]);olympe.dm.Pf.prototype.ab.L=olympe.D.K.F;olympe.dm.BrickMetadata=class extends olympe.dm.Pf{Ax(){return this.wb(olympe.dm.BrickMetadata.bc)}Hc(){return this.wb(olympe.dm.BrickMetadata.ua)}getType(){return this.wb(olympe.dm.BrickMetadata.T)}Lx(){return this.Qg(olympe.dm.BrickMetadata.Ib)}pe(){return null}Cw(){return this.bb(olympe.sc.Mb.Comment.C.cc(),olympe.sc.Mb.Comment)}uk(){return this.pk(olympe.dm.BrickMetadata.ka).nd().uk()}};olympe.dm.BrickMetadata.P=Af(olympe.dc.oa.C('01621fb84e3500000000',olympe.dm.BrickMetadata));
967
- olympe.dm.BrickMetadata.bc=olympe.dm.BrickMetadata.P.la('01621fb84e320000f001');olympe.dm.BrickMetadata.ua=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.T=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.Ib=olympe.dm.BrickMetadata.P.la('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.ka=olympe.dm.BrickMetadata.P.ra('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ad={bB:'private',dB:'public'};
968
- olympe.dm.BrickMetadata.$b={Ez:'experimental',sB:'stable',qz:'deprecated'};olympe.dm.BrickMetadata.Tc={cz:'business',OB:'technical'};m=olympe.dm.BrickMetadata.prototype;m.Ax.L=olympe.D.K.F;m.Hc.L=olympe.D.K.F;m.getType.L=olympe.D.K.F;m.Lx.L=olympe.D.K.O;m.pe.L=new olympe.D.K(()=>String,[]);m.Cw.L=new olympe.D.K(()=>olympe.dc.za,[]);m.uk.L=olympe.D.K.T;function Gi(a,b){b=b.startsWith('data.')?b.split('.')[1]:b;let c;return null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`)}
969
- function Yi(a,b){const c=a.query().fb(olympe.dm.rd.C.cc()).fb(olympe.dm.rd.F);a=a.query().fb(olympe.dm.jb.F.cc()).ag(olympe.dm.jb.G,!0).fb(olympe.sc.Dc.C.cc());const d=e=>e.ge().ag(olympe.dc.CloudObject.extendRel,!0).fb(olympe.dc.CloudObject.cj,!0).fb(olympe.dm.Relation.destinationModelRel).back(2).fb(olympe.dc.CloudObject.propertyRel,!0).fb(olympe.dm.Property.typeRel).observe(b);return rxjs.combineLatest([d(c),d(a)]).pipe(rxjs.operators.map(([e,...f])=>e.concat(...f)))}
970
- function uj(a,b){return a.observe(b,olympe.dm.DataSource.yr).pipe(rxjs.operators.map(()=>a.Fe(olympe.dc.sources.U.Ke)),rxjs.operators.distinctUntilChanged())}
971
- olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Yb=c;this.Ar=new Map([[olympe.dc.sources.U.Vl,olympe.dm.DataSource.ty],[olympe.dc.sources.U.Ke,olympe.dm.DataSource.yr],[olympe.dc.sources.U.cm,olympe.dm.DataSource.xy]])}V(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Qa.SERVER:this.tag}Fe(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,
972
- '_')}.${b}`))?d:Gi(this.X(),a))?e:this.Ar.has(c)?this.get(this.Ar.get(c)):null}Hc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Lb.Ys,c=olympe.dm.DataSource.Lb.zb,d=new olympe.dc.Request(olympe.dc.Request.C.Lb,a.V());return a.Yb.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.ma.gb('dc').warn(`Source ${a.name()} (${a.V()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.N.errors.Up;return e instanceof olympe.N.errors.fk||
967
+ olympe.dm.User.SAMLnameIdProp=olympe.dm.User.P.la('ff023000000000000036');w('olympe.dm.User.SAMLnameIdProp',olympe.dm.User.SAMLnameIdProp);olympe.dm.User.G=T(olympe.dm.User.P,olympe.dm.Ld.C);olympe.dm.User.Z=olympe.dm.User.P.ra('ff022000000000000002');olympe.dm.User.C=vf('014831d95fd7d12b8568','ADMIN_USER');olympe.dm.User.K=vf('0163d9653067b6237f62','GUEST_USER');m=olympe.dm.User.prototype;m.Tw.L=olympe.D.J.F;m.na.L=olympe.D.J.F;m.Sm.L=olympe.D.J.F;m.Qt.L=olympe.D.J.F;m.Pt.L=olympe.D.J.F;m.qx.L=olympe.D.J.F;
968
+ m.Ax.L=olympe.D.J.F;m.ox.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.Qf=class extends olympe.dc.CloudObject{Z(){return this.Pm()}ab(){return this.wb(olympe.dm.Qf.ab)}};olympe.dm.Qf.P=olympe.dc.oa.C('01621fb84e3300000000',olympe.dm.Qf);olympe.dm.Qf.ab=olympe.dm.Qf.P.la('01609de3f292e3c2c6ff');olympe.dm.Qf.prototype.Z.L=new olympe.D.J(()=>olympe.D.ld,[]);olympe.dm.Qf.prototype.ab.L=olympe.D.J.F;olympe.dm.BrickMetadata=class extends olympe.dm.Qf{Bx(){return this.wb(olympe.dm.BrickMetadata.bc)}Hc(){return this.wb(olympe.dm.BrickMetadata.ua)}getType(){return this.wb(olympe.dm.BrickMetadata.T)}Mx(){return this.Qg(olympe.dm.BrickMetadata.Ib)}oe(){return null}Dw(){return this.bb(olympe.sc.Mb.Comment.C.cc(),olympe.sc.Mb.Comment)}uk(){return this.pk(olympe.dm.BrickMetadata.ka).nd().uk()}};olympe.dm.BrickMetadata.P=Af(olympe.dc.oa.C('01621fb84e3500000000',olympe.dm.BrickMetadata));
969
+ olympe.dm.BrickMetadata.bc=olympe.dm.BrickMetadata.P.la('01621fb84e320000f001');olympe.dm.BrickMetadata.ua=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d94');olympe.dm.BrickMetadata.T=olympe.dm.BrickMetadata.P.la('01703376c4a81c0e9d00');olympe.dm.BrickMetadata.Ib=olympe.dm.BrickMetadata.P.la('01703376c4a81c0eaea5');olympe.dm.BrickMetadata.ka=olympe.dm.BrickMetadata.P.ra('0161ae97622bb21f335b');olympe.dm.BrickMetadata.ad={cB:'private',eB:'public'};
970
+ olympe.dm.BrickMetadata.$b={Fz:'experimental',tB:'stable',rz:'deprecated'};olympe.dm.BrickMetadata.Uc={dz:'business',PB:'technical'};m=olympe.dm.BrickMetadata.prototype;m.Bx.L=olympe.D.J.F;m.Hc.L=olympe.D.J.F;m.getType.L=olympe.D.J.F;m.Mx.L=olympe.D.J.O;m.oe.L=new olympe.D.J(()=>String,[]);m.Dw.L=new olympe.D.J(()=>olympe.dc.za,[]);m.uk.L=olympe.D.J.T;function Gi(a,b){b=b.startsWith('data.')?b.split('.')[1]:b;let c;return null!=(c=olympe.W.getParameter(`${'data.'}${a}.${b}`))?c:olympe.W.getParameter(`${'data.'}${b}`)}
971
+ function Yi(a,b){const c=a.query().gb(olympe.dm.rd.C.cc()).gb(olympe.dm.rd.F);a=a.query().gb(olympe.dm.jb.F.cc()).ag(olympe.dm.jb.G,!0).gb(olympe.sc.Ec.C.cc());const d=e=>e.fe().ag(olympe.dc.CloudObject.extendRel,!0).gb(olympe.dc.CloudObject.cj,!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)))}
972
+ function uj(a,b){return a.observe(b,olympe.dm.DataSource.zr).pipe(rxjs.operators.map(()=>a.Fe(olympe.dc.sources.U.Ke)),rxjs.operators.distinctUntilChanged())}
973
+ olympe.dm.DataSource=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.Yb=c;this.Br=new Map([[olympe.dc.sources.U.Vl,olympe.dm.DataSource.uy],[olympe.dc.sources.U.Ke,olympe.dm.DataSource.zr],[olympe.dc.sources.U.cm,olympe.dm.DataSource.yy]])}V(){return this.tag===olympe.dm.DataSource.SERVER?olympe.dc.Qa.SERVER:this.tag}Fe(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,
974
+ '_')}.${b}`))?d:Gi(this.X(),a))?e:this.Br.has(c)?this.get(this.Br.get(c)):null}Hc(){const a=this;return v(function*(){const b=olympe.dm.DataSource.Lb.Zs,c=olympe.dm.DataSource.Lb.zb,d=new olympe.dc.Request(olympe.dc.Request.C.Lb,a.V());return a.Yb.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.ma.hb('dc').warn(`Source ${a.name()} (${a.V()}) has encountered issues: ${e}`);return g}).catch(e=>{const f=olympe.N.errors.Vp;return e instanceof olympe.N.errors.fk||
973
975
  e instanceof f?b:c})})}init(){const a=this;return v(function*(){if(a.constructor===olympe.dm.DataSource)throw Error(`Data source ${a.name()} (${a.tag}) has no implementation (is the file missing ?)`);})}destroy(){return v(function*(){})}healthCheck(){return v(function*(){})}executeQuery(a){return v(function*(){return olympe.dc.query.td.Ti(a)})}applyTransaction(){return v(function*(){})}uploadFileContent(){return v(function*(){throw Error('Should not try to upload files with SELF source');})}downloadFileContent(){return v(function*(){throw Error('Should not try to download files with SELF source');
974
976
  })}deleteFileContent(){return v(function*(){})}};olympe.dm.DataSource.prototype.deleteFileContent=olympe.dm.DataSource.prototype.deleteFileContent;olympe.dm.DataSource.prototype.downloadFileContent=olympe.dm.DataSource.prototype.downloadFileContent;olympe.dm.DataSource.prototype.uploadFileContent=olympe.dm.DataSource.prototype.uploadFileContent;olympe.dm.DataSource.prototype.applyTransaction=olympe.dm.DataSource.prototype.applyTransaction;olympe.dm.DataSource.prototype.executeQuery=olympe.dm.DataSource.prototype.executeQuery;
975
977
  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.Fe;olympe.dm.DataSource.prototype.getId=olympe.dm.DataSource.prototype.V;olympe.dm.DataSource.P=olympe.dc.oa.C('ff021000000000000060',olympe.dm.DataSource,olympe.dc.R.Ag);
976
- olympe.dm.DataSource.Gh=olympe.dm.DataSource.P.la('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Gh);olympe.dm.DataSource.lD=olympe.dm.DataSource.P.la('ff023000000000000061');olympe.dm.DataSource.ty=olympe.dm.DataSource.P.la('ff023000000000000062');olympe.dm.DataSource.yr=olympe.dm.DataSource.P.la('ff023000000000000063');olympe.dm.DataSource.Er=olympe.dm.DataSource.P.la('ff023000000000000064');olympe.dm.DataSource.xy=olympe.dm.DataSource.P.la('ff023000000000000065');
977
- olympe.dm.DataSource.dj=olympe.dm.DataSource.P.ra('ff022000000000000060');olympe.dm.DataSource.SERVER=vf('00000000000000000060','Server source');olympe.dm.DataSource.Ke={oA:'hybrid',In:'bus',cp:'http'};olympe.dm.DataSource.Lb={vh:'ready',zb:'error',Ys:'down',de:'offline'};olympe.dm.rd=class extends olympe.dc.CloudObject{};olympe.dm.rd.P=olympe.dc.oa.C('ff021000000000000070',olympe.dm.rd);olympe.dm.rd.C=olympe.dm.rd.P.ra('ff023000000000000071');olympe.dm.rd.F=olympe.dm.rd.P.ra('ff023000000000000072');olympe.dm.rd.G=olympe.dm.rd.P.ra('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{J(){return new olympe.dc.za(this.X(),[new olympe.dc.da.ze(olympe.dm.Kb.C.X(),olympe.dc.wa.DESTINATION,olympe.dc.da.Fq.ut,olympe.dc.da.Fq.vt),olympe.dm.Kb.J])}pe(){return olympe.sc.zd.Be.ht}C(){return this.bb(olympe.dm.Kb.C,olympe.dm.Kb)}O(){return this.bb(olympe.dm.Kb.J)}};olympe.dm.Kb.P=olympe.dc.oa.C('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.C=olympe.dm.Kb.P.ra('016a697ef00ce7554691');olympe.dm.Kb.Fa=T(olympe.dm.Kb.P,olympe.dm.Kb.C);
978
- olympe.dm.Kb.J=olympe.dm.Kb.P.ra('016a697ef00ce7554692');T(olympe.dc.CloudObject.P,olympe.dm.Kb.J);olympe.dm.Kb.prototype.J.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.O.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Jc=class extends olympe.dm.Kb{C(){return this.X()===olympe.dm.Jc.ea?this.bb(olympe.dm.Jc.O,olympe.dm.Kb):this.bb(olympe.dm.Jc.Z,olympe.dm.Kb)}};olympe.dm.Jc.P=olympe.dc.oa.C('ff021000000000000020',olympe.dm.Jc);olympe.dm.Jc.Z=olympe.dm.Jc.P.ra('017e9c34cf48bd6965c1');olympe.dm.Jc.O=olympe.dm.Jc.P.ra('017e9c2e013e06bfffd9');olympe.dm.Jc.yk=olympe.dm.Jc.P.ra('01811f12ad77673770d4');olympe.dm.Jc.ea=vf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Jc.hc=vf('10000000000000000001','OLYMPE_FOLDER');
979
- olympe.dm.Jc.Ub=vf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Jc.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Rw(){return this.wb(olympe.dm.Module.O)}bx(){return this.cd(olympe.dm.Module.T)}Qt(){return this.wb(olympe.dm.Module.F)}ix(){return this.wb(olympe.dm.Module.Z)}Dw(){return this.wb(olympe.dm.Module.G)}ex(){return this.bb(olympe.dm.Module.J,olympe.dm.Module)}qx(){return this.bb(olympe.dm.Module.C,olympe.dm.Gd)}};olympe.dm.Module.P=olympe.dc.oa.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.P.la('ff023000000000000042');
980
- olympe.dm.Module.T=olympe.dm.Module.P.la('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.la('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.P.la('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.P.la('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.la('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.ra('ff022000000000000013');olympe.dm.Module.J=olympe.dm.Module.P.ra('ff022000000000000014');
981
- olympe.dm.Module.aa=vf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Rw.L=olympe.D.K.F;m.bx.L=olympe.D.K.G;m.Qt.L=olympe.D.K.F;m.ix.L=olympe.D.K.F;m.Dw.L=olympe.D.K.F;m.ex.L=new olympe.D.K(()=>olympe.dc.za,[]);m.qx.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(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.Xd().fromModel(a);a=b.create(a,f).Uh(g);b=olympe.D.ib.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
982
- b);this.C=c;this.G=d;this.F=e}Qr(){return this.wb(olympe.dm.File.mimeTypeProp)}rk(a,b){const c=olympe.D.$a().G(a);a=olympe.D.$a().G(d=>null==b?void 0:b(`${d}`));this.C.J(this).then(d=>{c(d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength))}).catch(a)}Om(a,b){this.rk(c=>{a(Ua(c))},b)}sk(a,b){const c=olympe.D.$a().G(a),d=olympe.D.$a().G(h=>null==b?void 0:b(`${h}`)),e=this.get(olympe.dm.File.C),f=this.get(olympe.dm.File.urlProp),g=this.get(olympe.dm.File.mimeTypeProp);e||(null==f?0:f.startsWith('blob:'))||
983
- (null==f?0:f.startsWith('stream:'))?this.C.J(this).then(h=>{c(`data:${g};base64,${this.F.C(h)}`)}).catch(d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.$a().G(b);olympe.D.cs([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.ob(f=>{c&&c(f)})})}Ay(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}up(){return this.wb(olympe.dm.File.urlProp)}tp(){return this.wb(olympe.dm.File.fileNameProp)}Hw(){return this.Xi(olympe.dm.File.creationDateProp)}ax(){return this.Xi(olympe.dm.File.modificationDateProp)}Kx(){return this.Qg(olympe.dm.File.C)}};
984
- olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.Ay;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.sk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Om;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.rk;olympe.dm.File.P=olympe.dc.oa.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.wj,olympe.net.R.Ea,olympe.Y.R.jg);olympe.dm.File.nameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
978
+ olympe.dm.DataSource.Hh=olympe.dm.DataSource.P.la('ff023000000000000060');w('olympe.dm.DataSource.activatedProp',olympe.dm.DataSource.Hh);olympe.dm.DataSource.mD=olympe.dm.DataSource.P.la('ff023000000000000061');olympe.dm.DataSource.uy=olympe.dm.DataSource.P.la('ff023000000000000062');olympe.dm.DataSource.zr=olympe.dm.DataSource.P.la('ff023000000000000063');olympe.dm.DataSource.Fr=olympe.dm.DataSource.P.la('ff023000000000000064');olympe.dm.DataSource.yy=olympe.dm.DataSource.P.la('ff023000000000000065');
979
+ olympe.dm.DataSource.dj=olympe.dm.DataSource.P.ra('ff022000000000000060');olympe.dm.DataSource.SERVER=vf('00000000000000000060','Server source');olympe.dm.DataSource.Ke={pA:'hybrid',In:'bus',cp:'http'};olympe.dm.DataSource.Lb={wh:'ready',zb:'error',Zs:'down',de:'offline'};olympe.dm.rd=class extends olympe.dc.CloudObject{};olympe.dm.rd.P=olympe.dc.oa.C('ff021000000000000070',olympe.dm.rd);olympe.dm.rd.C=olympe.dm.rd.P.ra('ff023000000000000071');olympe.dm.rd.F=olympe.dm.rd.P.ra('ff023000000000000072');olympe.dm.rd.G=olympe.dm.rd.P.ra('ff023000000000000073');olympe.dm.Kb=class extends olympe.dm.BrickMetadata{K(){return new olympe.dc.za(this.X(),[new olympe.dc.da.ye(olympe.dm.Kb.C.X(),olympe.dc.wa.DESTINATION,olympe.dc.da.Gq.vt,olympe.dc.da.Gq.wt),olympe.dm.Kb.K])}oe(){return olympe.sc.zd.Be.it}C(){return this.bb(olympe.dm.Kb.C,olympe.dm.Kb)}O(){return this.bb(olympe.dm.Kb.K)}};olympe.dm.Kb.P=olympe.dc.oa.C('01612df1db9749227626',olympe.dm.Kb);olympe.dm.Kb.C=olympe.dm.Kb.P.ra('016a697ef00ce7554691');olympe.dm.Kb.Fa=T(olympe.dm.Kb.P,olympe.dm.Kb.C);
980
+ olympe.dm.Kb.K=olympe.dm.Kb.P.ra('016a697ef00ce7554692');T(olympe.dc.CloudObject.P,olympe.dm.Kb.K);olympe.dm.Kb.prototype.K.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.C.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.Kb.prototype.O.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.Jc=class extends olympe.dm.Kb{C(){return this.X()===olympe.dm.Jc.ea?this.bb(olympe.dm.Jc.O,olympe.dm.Kb):this.bb(olympe.dm.Jc.Z,olympe.dm.Kb)}};olympe.dm.Jc.P=olympe.dc.oa.C('ff021000000000000020',olympe.dm.Jc);olympe.dm.Jc.Z=olympe.dm.Jc.P.ra('017e9c34cf48bd6965c1');olympe.dm.Jc.O=olympe.dm.Jc.P.ra('017e9c2e013e06bfffd9');olympe.dm.Jc.yk=olympe.dm.Jc.P.ra('01811f12ad77673770d4');olympe.dm.Jc.ea=vf('10000000000000000000','ROOT_OF_ROOTS');olympe.dm.Jc.hc=vf('10000000000000000001','OLYMPE_FOLDER');
981
+ olympe.dm.Jc.Vb=vf('10000000000000000002','INTERNAL_FOLDER');olympe.dm.Jc.prototype.C.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.Module=class extends olympe.dc.CloudObject{Sw(){return this.wb(olympe.dm.Module.O)}ex(){return this.cd(olympe.dm.Module.T)}Rt(){return this.wb(olympe.dm.Module.F)}jx(){return this.wb(olympe.dm.Module.Z)}Ew(){return this.wb(olympe.dm.Module.G)}gx(){return this.bb(olympe.dm.Module.K,olympe.dm.Module)}sx(){return this.bb(olympe.dm.Module.C,olympe.dm.Gd)}};olympe.dm.Module.P=olympe.dc.oa.C('ff021000000000000040',olympe.dm.Module);olympe.dm.Module.O=olympe.dm.Module.P.la('ff023000000000000042');
982
+ olympe.dm.Module.T=olympe.dm.Module.P.la('ff023000000000000043');olympe.dm.Module.F=olympe.dm.Module.P.la('ff023000000000000044');olympe.dm.Module.Z=olympe.dm.Module.P.la('ff023000000000000045');olympe.dm.Module.G=olympe.dm.Module.P.la('ff023000000000000046');olympe.dm.Module.creationDateProp=olympe.dm.Module.P.la('ff023000000000000049');olympe.dm.Module.C=olympe.dm.Module.P.ra('ff022000000000000013');olympe.dm.Module.K=olympe.dm.Module.P.ra('ff022000000000000014');
983
+ olympe.dm.Module.aa=vf('016a69b9bceabd815b77','OLYMPE_SERVER_MODULE');m=olympe.dm.Module.prototype;m.Sw.L=olympe.D.J.F;m.ex.L=olympe.D.J.G;m.Rt.L=olympe.D.J.F;m.jx.L=olympe.D.J.F;m.Ew.L=olympe.D.J.F;m.gx.L=new olympe.D.J(()=>olympe.dc.za,[]);m.sx.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.File=class extends olympe.dc.CloudObject{static F(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.Xd().fromModel(a);a=b.create(a,f).Vh(g);b=olympe.D.fb.now();Z(Z(Z(Z(Z(Z(a,olympe.dm.File.fileNameProp,null!=c?c:'file'),olympe.dm.File.urlProp,d),olympe.dm.File.creationDateProp,b),olympe.dm.File.modificationDateProp,b),olympe.dm.File.mimeTypeProp,e||'application/data'),olympe.dm.File.C,!1);return a.X()}constructor(a,b,c,d,e){super(a,
984
+ b);this.C=c;this.G=d;this.F=e}Rr(){return this.wb(olympe.dm.File.mimeTypeProp)}rk(a,b){const c=olympe.D.$a().G(a);a=olympe.D.$a().G(d=>null==b?void 0:b(`${d}`));this.C.K(this).then(d=>{c(d.buffer.slice(d.byteOffset,d.byteOffset+d.byteLength))}).catch(a)}Om(a,b){this.rk(c=>{a(Ua(c))},b)}sk(a,b){const c=olympe.D.$a().G(a),d=olympe.D.$a().G(h=>null==b?void 0:b(`${h}`)),e=this.get(olympe.dm.File.C),f=this.get(olympe.dm.File.urlProp),g=this.get(olympe.dm.File.mimeTypeProp);e||(null==f?0:f.startsWith('blob:'))||
985
+ (null==f?0:f.startsWith('stream:'))?this.C.K(this).then(h=>{c(`data:${g};base64,${this.F.C(h)}`)}).catch(d):'string'===typeof f?a(f):b(`No content nor URL associated to the file ${this.X()}`)}rename(a,b){const c=b&&olympe.D.$a().G(b);olympe.D.ds([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.ob(f=>{c&&c(f)})})}By(){this.G.O(this.get(olympe.dm.File.mimeTypeProp))}vp(){return this.wb(olympe.dm.File.urlProp)}up(){return this.wb(olympe.dm.File.fileNameProp)}Iw(){return this.Xi(olympe.dm.File.creationDateProp)}bx(){return this.Xi(olympe.dm.File.modificationDateProp)}Lx(){return this.Qg(olympe.dm.File.C)}};
986
+ olympe.dm.File.prototype.saveAs=olympe.dm.File.prototype.By;olympe.dm.File.prototype.getContentUrl=olympe.dm.File.prototype.sk;olympe.dm.File.prototype.getContentAsString=olympe.dm.File.prototype.Om;olympe.dm.File.prototype.getContentAsBinary=olympe.dm.File.prototype.rk;olympe.dm.File.P=olympe.dc.oa.C('ff021000000000000030',olympe.dm.File,olympe.dc.R.wj,olympe.net.R.Ea,olympe.Y.R.jg);olympe.dm.File.nameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.nameProp',olympe.dm.File.nameProp);
985
987
  olympe.dm.File.fileNameProp=olympe.dm.File.P.la('ff023000000000000050');w('olympe.dm.File.fileNameProp',olympe.dm.File.fileNameProp);olympe.dm.File.creationDateProp=olympe.dm.File.P.la('ff023000000000000051');w('olympe.dm.File.creationDateProp',olympe.dm.File.creationDateProp);olympe.dm.File.modificationDateProp=olympe.dm.File.P.la('ff023000000000000055');w('olympe.dm.File.modificationDateProp',olympe.dm.File.modificationDateProp);olympe.dm.File.mimeTypeProp=olympe.dm.File.P.la('ff023000000000000052');
986
- w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.P.la('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.la('ff023000000000000054');olympe.dm.File.P.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.ya=[olympe.D.File];m=olympe.dm.File.prototype;m.Qr.L=olympe.D.K.F;m.rk.L=new olympe.D.K(()=>{},[]);m.Om.L=new olympe.D.K(()=>{},[]);
987
- m.sk.L=new olympe.D.K(()=>{},[]);m.rename.L=olympe.D.K.C;m.up.L=olympe.D.K.F;m.tp.L=olympe.D.K.F;m.Hw.L=new olympe.D.K(()=>olympe.D.ib,[]);m.ax.L=new olympe.D.K(()=>olympe.D.ib,[]);m.Kx.L=olympe.D.K.O;olympe.dm.Gd=class extends olympe.dc.CloudObject{C(){return this.wb(olympe.dm.Gd.F)}G(){return this.cd(olympe.dm.Gd.G)}F(){return this.bb(olympe.dm.Gd.C,olympe.dm.Module)}};olympe.dm.Gd.P=olympe.dc.oa.C('ff021000000000000041',olympe.dm.Gd);olympe.dm.Gd.F=olympe.dm.Gd.P.la('ff023000000000000047');olympe.dm.Gd.G=olympe.dm.Gd.P.la('ff023000000000000048');olympe.dm.Gd.C=olympe.dm.Module.C.cc();olympe.dm.Gd.prototype.C.L=olympe.D.K.F;olympe.dm.Gd.prototype.G.L=olympe.D.K.G;
988
- olympe.dm.Gd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.jb=class extends olympe.dm.Jc{C(){return this.bb(olympe.dm.Kb.C,olympe.dm.Kb)}G(){return this.wb(olympe.dm.jb.aa)}T(){return this.wb(olympe.dm.jb.vb)}F(){return this.bb(olympe.dm.jb.G,olympe.dm.jb)}};olympe.dm.jb.P=olympe.dc.oa.C('0163d9594700fcf61e54',olympe.dm.jb);olympe.dm.jb.aa=olympe.dm.jb.P.la('017869c7d2833c9492c1');olympe.dm.jb.Zr=olympe.dm.jb.P.la('017869c7d2833c9492c2');olympe.dm.jb.Td=olympe.dm.jb.P.la('017869c7d2833c9492c3');olympe.dm.jb.vb=olympe.dm.jb.P.la('017869c80bb9929c76d0');
989
- olympe.dm.jb.kb=olympe.dm.jb.P.ra('ff02200000000000002a');olympe.dm.jb.G=olympe.dm.jb.P.ra('ff02200000000000002b');olympe.dm.jb.yf=T(olympe.dm.jb.P,olympe.dm.jb.G);olympe.dm.jb.F=olympe.dm.jb.P.ra('ff02200000000000002c');olympe.dm.jb.Mh=olympe.dm.jb.P.ra('017e9c412e2b944bc48f');olympe.dm.jb.De=olympe.dm.jb.P.ra('017e9c412e2b944bd590');olympe.dm.jb.Yr=olympe.dm.jb.P.ra('017e9c416872a89d3415');olympe.dm.jb.Ak=olympe.dm.jb.P.ra('017ebf8fe5c506662098');T(olympe.dc.CloudObject.P,olympe.dm.jb.kb);
990
- olympe.dm.jb.Bc=vf('100000000000000000dd','PRIMORDIAL');olympe.dm.jb.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.jb.prototype.G.L=olympe.D.K.F;olympe.dm.jb.prototype.T.L=olympe.D.K.F;olympe.dm.jb.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.qc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.qc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.pk(olympe.dm.Property.typeRel).nd()}Oc(){return this.C().na().zr(this.na())}};olympe.dm.Property.P=olympe.dc.oa.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);
991
- w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.K.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Xw(){return olympe.D.Oa.EMPTY}zw(){return this.cd(olympe.dm.Relation.F)}jx(){return this.cd(olympe.dm.Relation.G)}Jr(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}Sr(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Oc(){return this.Sr().na().concat(['-',this.na(),'->',this.Jr().na()])}};olympe.dm.Relation.P=olympe.dc.oa.C('ff021000000000000006',olympe.dm.Relation);
992
- olympe.dm.Relation.G=olympe.dm.Relation.P.la('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.P.la('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.P.la(olympe.dc.Ob.vo);olympe.dm.Relation.Z=olympe.dm.Relation.P.la(olympe.dc.Ob.Cc);olympe.dm.Relation.ka=olympe.dm.Relation.P.la(olympe.dc.Ob.Uf);olympe.dm.Relation.ua=olympe.dm.Relation.P.la(olympe.dc.Ob.fv);olympe.dm.Relation.aa=olympe.dm.Relation.P.la(olympe.dc.Ob.Zs);olympe.dm.Relation.T=olympe.dm.Relation.P.la('ff023000000000000031');
993
- olympe.dm.Relation.originModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.cj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.Dr);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={tt:0,Cs:5,vq:1,Tu:4,qm:2,em:8,Dz:10,jB:6,kB:9,Me:6,mB:9};olympe.dm.Relation.J={PA:3,yu:4,CA:5,BA:6};olympe.dm.Relation.O=olympe.dm.Ok.Au+olympe.dm.Ok.Vs;
994
- m=olympe.dm.Relation.prototype;m.Xw.L=olympe.D.K.F;m.zw.L=olympe.D.K.G;m.jx.L=olympe.D.K.G;m.Jr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Sr.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);function nm(a){a=olympe.dc.ga(a);if(olympe.dc.ia().Ef(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.P.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.P.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.P.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.P.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.ye=class extends olympe.dc.CloudObject{getValue(){}};
995
- olympe.dm.ye.P=olympe.dc.oa.C('ff021000000000000019',olympe.dm.ye);olympe.dm.String=class extends olympe.dm.ye{getValue(){return this.wb(olympe.dm.String.valueProp)}zc(){return this.get(olympe.dm.String.valueProp)}toString(){let a;return null!=(a=this.get(olympe.dm.String.valueProp))?a:''}};olympe.dm.String.P=olympe.dc.oa.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.la('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.L=olympe.D.K.F;
996
- olympe.dm.String.prototype.toString.L=olympe.D.K.C;olympe.dm.Boolean=class extends olympe.dm.ye{getValue(){return this.Qg(olympe.dm.Boolean.valueProp)}zc(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.oa.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.K.O;olympe.dm.Color=class extends olympe.dm.ye{getValue(){return this.Tr()}zc(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.P=olympe.dc.oa.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.K(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.ye{getValue(){return this.Xi(olympe.dm.DateTime.valueProp)}zc(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.oa.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.K(()=>olympe.D.ib,[]);olympe.dm.Enum=class extends olympe.dm.String{na(){return olympe.D.va([super.na(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Oa)}Wd(){return this.cd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.P=olympe.dc.oa.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.la('017a7690c915975ea995');olympe.dm.Enum.prototype.Wd.L=olympe.D.K.G;olympe.dm.Rf=class extends olympe.dm.BrickMetadata{yx(){return this.fb(olympe.dc.CloudObject.instancesRel).Jk(olympe.dm.Enum.rankProp,olympe.dc.query.Nj.ASC).nd()}static create(a,b){b=a.create(olympe.dm.Rf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ha(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Rf.create=olympe.dm.Rf.create;olympe.dm.Rf.prototype.getValues=olympe.dm.Rf.prototype.yx;olympe.dm.Rf.P=olympe.dc.oa.C('017a768f966fc08ebb98',olympe.dm.Rf);olympe.dm.Number=class extends olympe.dm.ye{getValue(){return this.cd(olympe.dm.Number.valueProp)}zc(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.oa.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.la('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.L=olympe.D.K.G;olympe.sc={};olympe.sc.R={Ca:'sc.Logger',Uj:'sc.RootContext',ee:'sc.Serializer'};olympe.sc.U={Je:'sc.app',Mf:'sc.debug',un:'sc.autostartProfiler',qo:'sc.debugger',Ws:'sc.disableTheme',PRODUCTION:'sc.production',zu:'sc.onstartTimeout',xq:'sc.remoteActionTimeout'};
997
- olympe.W.config(a=>{F(a,olympe.sc.U.Je,'');F(a,olympe.sc.U.Mf,!1);F(a,olympe.sc.U.Ws,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.zu,2E4);F(a,olympe.sc.U.xq,3E4);F(a,olympe.sc.U.un,!1);E(a,olympe.sc.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('sc'));D(a,olympe.sc.R.ee,olympe.sc.fc,olympe.dc.db.R.Ea);La(a,olympe.dc.sources.R.ee,olympe.sc.R.ee);E(a,olympe.sc.R.Uj,[new olympe.W.ja(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.mg('root','root',null);olympe.sc.fn=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
998
- 'olympe.sc');olympe.W.run([olympe.sc.R.Uj,new olympe.W.ja(olympe.N.U.al)],(a,b)=>{olympe.ke().ctx=a;olympe.ke().oVersion=()=>b});olympe.sc.Ym=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.C.cc());olympe.sc.jD=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Yc),olympe.sc.Yc.C,c||null),olympe.sc.Yc.G,d||null);a.Ha(olympe.sc.Yc.F,c,b);a.Ha(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.Qi=(a,b)=>{a=olympe.dc.nb.Aw(b)(a);return a instanceof olympe.sc.Jd?a.C():a};
999
- olympe.sc.BD=function(a){const b=olympe.dc.CloudObject.containsRel.cc();var c=olympe.dc.ga(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Rb(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ma.gb('sc').warn(`Object ${c} has no container`),[];a.Rb(c,olympe.sc.logic.qb)||g===a.Jb(c,olympe.sc.Runnable.C.cc())||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.Rg(e[0],
1000
- olympe.dm.Kb.Fa));e=e.concat(a.Rg(e[e.length-1],olympe.dm.Jc.Z.cc()));e=e.concat(a.Rg(e[e.length-1],olympe.dm.Jc.O.cc()));return[...d,...e].reverse()};olympe.sc.CD=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.rg:a.startsWith('video/')?olympe.sc.Ch:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Ic:olympe.dm.File};
1001
- olympe.sc.AD=a=>a instanceof olympe.sc.rg?'image/*':a instanceof olympe.sc.Ch?'video/*':a instanceof olympe.sc.Ic?'font/*,application/font-woff':null;olympe.sc.Ya={};function om(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.ga(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.Jh(a,void 0,b);for(d=f.getParent();d&&d.ka&&!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.Ma(olympe.sc.xa.C.PRODUCTION))?b:!1}
1002
- olympe.sc.xa=class{constructor(a=olympe.sc.fn){this.C=a;this.H=olympe.ma.gb('sc');this.G=null}V(){return this.C.V()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}Bw(a){const b=olympe.dc.ia();let c=this.getParent();const d=e=>{if(e.je()){const f=b.model(e.je());if(f&&b.Ra(f,olympe.sc.Ua.ea)||a.modelTag&&!b.Rb(e.je(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}je(){return this.C.je()}F(){return this.C.C}set(a,
988
+ w('olympe.dm.File.mimeTypeProp',olympe.dm.File.mimeTypeProp);olympe.dm.File.urlProp=olympe.dm.File.P.la('ff023000000000000053');w('olympe.dm.File.urlProp',olympe.dm.File.urlProp);olympe.dm.File.C=olympe.dm.File.P.la('ff023000000000000054');olympe.dm.File.P.C=olympe.dm.File.F.bind(null,olympe.dm.File);olympe.dm.File.O='application/data';olympe.dm.File.ya=[olympe.D.File];m=olympe.dm.File.prototype;m.Rr.L=olympe.D.J.F;m.rk.L=new olympe.D.J(()=>{},[]);m.Om.L=new olympe.D.J(()=>{},[]);
989
+ m.sk.L=new olympe.D.J(()=>{},[]);m.rename.L=olympe.D.J.C;m.vp.L=olympe.D.J.F;m.up.L=olympe.D.J.F;m.Iw.L=new olympe.D.J(()=>olympe.D.fb,[]);m.bx.L=new olympe.D.J(()=>olympe.D.fb,[]);m.Lx.L=olympe.D.J.O;olympe.dm.Gd=class extends olympe.dc.CloudObject{C(){return this.wb(olympe.dm.Gd.F)}G(){return this.cd(olympe.dm.Gd.G)}F(){return this.bb(olympe.dm.Gd.C,olympe.dm.Module)}};olympe.dm.Gd.P=olympe.dc.oa.C('ff021000000000000041',olympe.dm.Gd);olympe.dm.Gd.F=olympe.dm.Gd.P.la('ff023000000000000047');olympe.dm.Gd.G=olympe.dm.Gd.P.la('ff023000000000000048');olympe.dm.Gd.C=olympe.dm.Module.C.cc();olympe.dm.Gd.prototype.C.L=olympe.D.J.F;olympe.dm.Gd.prototype.G.L=olympe.D.J.G;
990
+ olympe.dm.Gd.prototype.F.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.jb=class extends olympe.dm.Jc{C(){return this.bb(olympe.dm.Kb.C,olympe.dm.Kb)}G(){return this.wb(olympe.dm.jb.aa)}T(){return this.wb(olympe.dm.jb.vb)}F(){return this.bb(olympe.dm.jb.G,olympe.dm.jb)}};olympe.dm.jb.P=olympe.dc.oa.C('0163d9594700fcf61e54',olympe.dm.jb);olympe.dm.jb.aa=olympe.dm.jb.P.la('017869c7d2833c9492c1');olympe.dm.jb.$r=olympe.dm.jb.P.la('017869c7d2833c9492c2');olympe.dm.jb.Td=olympe.dm.jb.P.la('017869c7d2833c9492c3');olympe.dm.jb.vb=olympe.dm.jb.P.la('017869c80bb9929c76d0');
991
+ olympe.dm.jb.kb=olympe.dm.jb.P.ra('ff02200000000000002a');olympe.dm.jb.G=olympe.dm.jb.P.ra('ff02200000000000002b');olympe.dm.jb.zf=T(olympe.dm.jb.P,olympe.dm.jb.G);olympe.dm.jb.F=olympe.dm.jb.P.ra('ff02200000000000002c');olympe.dm.jb.Nh=olympe.dm.jb.P.ra('017e9c412e2b944bc48f');olympe.dm.jb.De=olympe.dm.jb.P.ra('017e9c412e2b944bd590');olympe.dm.jb.Zr=olympe.dm.jb.P.ra('017e9c416872a89d3415');olympe.dm.jb.Ak=olympe.dm.jb.P.ra('017ebf8fe5c506662098');T(olympe.dc.CloudObject.P,olympe.dm.jb.kb);
992
+ olympe.dm.jb.Cc=vf('100000000000000000dd','PRIMORDIAL');olympe.dm.jb.prototype.C.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.jb.prototype.G.L=olympe.D.J.F;olympe.dm.jb.prototype.T.L=olympe.D.J.F;olympe.dm.jb.prototype.F.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.dm.Property=class extends olympe.dc.CloudObject{C(){return this.qc(olympe.dm.Property.definingModelRel,olympe.dc.CloudObject)}getType(){return this.qc(olympe.dm.Property.typeRel,olympe.dc.CloudObject)}F(){return this.pk(olympe.dm.Property.typeRel).nd()}Pc(){return this.C().na().Ar(this.na())}};olympe.dm.Property.P=olympe.dc.oa.C('ff021000000000000005',olympe.dm.Property);olympe.dm.Property.definingModelRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.propertyRel);
993
+ w('olympe.dm.Property.definingModelRel',olympe.dm.Property.definingModelRel);olympe.dm.Property.typeRel=T(olympe.dm.Property.P,olympe.dc.CloudObject.typeRel);w('olympe.dm.Property.typeRel',olympe.dm.Property.typeRel);olympe.dm.Property.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.dm.Property.prototype.F.L=olympe.D.J.C;olympe.dm.Relation=class extends olympe.dc.CloudObject{constructor(a,b){super(a,b)}Yw(){return olympe.D.Oa.EMPTY}Aw(){return this.cd(olympe.dm.Relation.F)}kx(){return this.cd(olympe.dm.Relation.G)}Kr(){return this.bb(olympe.dm.Relation.destinationModelRel,olympe.dc.CloudObject).Gc()}Tr(){return this.bb(olympe.dm.Relation.originModelRel,olympe.dc.CloudObject).Gc()}Pc(){return this.Tr().na().concat(['-',this.na(),'->',this.Kr().na()])}};olympe.dm.Relation.P=olympe.dc.oa.C('ff021000000000000006',olympe.dm.Relation);
994
+ olympe.dm.Relation.G=olympe.dm.Relation.P.la('ff023000000000000030');olympe.dm.Relation.F=olympe.dm.Relation.P.la('ff023000000000000034');olympe.dm.Relation.ea=olympe.dm.Relation.P.la(olympe.dc.Ob.vo);olympe.dm.Relation.Z=olympe.dm.Relation.P.la(olympe.dc.Ob.Dc);olympe.dm.Relation.ka=olympe.dm.Relation.P.la(olympe.dc.Ob.Uf);olympe.dm.Relation.ua=olympe.dm.Relation.P.la(olympe.dc.Ob.gv);olympe.dm.Relation.aa=olympe.dm.Relation.P.la(olympe.dc.Ob.$s);olympe.dm.Relation.T=olympe.dm.Relation.P.la('ff023000000000000031');
995
+ olympe.dm.Relation.originModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.cj);w('olympe.dm.Relation.originModelRel',olympe.dm.Relation.originModelRel);olympe.dm.Relation.destinationModelRel=T(olympe.dm.Relation.P,olympe.dc.CloudObject.Er);w('olympe.dm.Relation.destinationModelRel',olympe.dm.Relation.destinationModelRel);olympe.dm.Relation.C={ut:0,Ds:5,wq:1,Uu:4,qm:2,em:8,Ez:10,kB:6,lB:9,Me:6,nB:9};olympe.dm.Relation.K={QA:3,zu:4,DA:5,CA:6};olympe.dm.Relation.O=olympe.dm.Ok.Bu+olympe.dm.Ok.Ws;
996
+ m=olympe.dm.Relation.prototype;m.Yw.L=olympe.D.J.F;m.Aw.L=olympe.D.J.G;m.kx.L=olympe.D.J.G;m.Kr.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Tr.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);function om(a){a=olympe.dc.ga(a);if(olympe.dc.ia().Ff(a,olympe.dm.String))return olympe.dm.String.valueProp;switch(a){case olympe.dm.Number.P.X():return olympe.dm.Number.valueProp;case olympe.dm.Boolean.P.X():return olympe.dm.Boolean.valueProp;case olympe.dm.DateTime.P.X():return olympe.dm.DateTime.valueProp;case olympe.dm.Color.P.X():return olympe.dm.Color.valueProp;default:throw Error('Unknown primitive model: '+a);}}olympe.dm.xe=class extends olympe.dc.CloudObject{getValue(){}};
997
+ olympe.dm.xe.P=olympe.dc.oa.C('ff021000000000000019',olympe.dm.xe);olympe.dm.String=class extends olympe.dm.xe{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.P=olympe.dc.oa.C('ff021000000000000011',olympe.dm.String);olympe.dm.String.valueProp=olympe.dm.String.P.la('ff023000000000000026');w('olympe.dm.String.valueProp',olympe.dm.String.valueProp);olympe.dm.String.prototype.getValue.L=olympe.D.J.F;
998
+ olympe.dm.String.prototype.toString.L=olympe.D.J.C;olympe.dm.Boolean=class extends olympe.dm.xe{getValue(){return this.Qg(olympe.dm.Boolean.valueProp)}Ac(){return this.get(olympe.dm.Boolean.valueProp)}};olympe.dm.Boolean.P=olympe.dc.oa.C('ff021000000000000012',olympe.dm.Boolean);olympe.dm.Boolean.valueProp=olympe.dm.Boolean.P.la('ff023000000000000027');w('olympe.dm.Boolean.valueProp',olympe.dm.Boolean.valueProp);olympe.dm.Boolean.prototype.getValue.L=olympe.D.J.O;olympe.dm.Color=class extends olympe.dm.xe{getValue(){return this.Ur()}Ac(){return this.get(olympe.dm.Color.valueProp)}};olympe.dm.Color.P=olympe.dc.oa.C('ff021000000000000017',olympe.dm.Color);olympe.dm.Color.valueProp=olympe.dm.Color.P.la('ff023000000000000032');w('olympe.dm.Color.valueProp',olympe.dm.Color.valueProp);olympe.dm.Color.prototype.getValue.L=new olympe.D.J(()=>olympe.D.Color,[]);olympe.dm.DateTime=class extends olympe.dm.xe{getValue(){return this.Xi(olympe.dm.DateTime.valueProp)}Ac(){return this.get(olympe.dm.DateTime.valueProp)}};olympe.dm.DateTime.P=olympe.dc.oa.C('ff021000000000000014',olympe.dm.DateTime);olympe.dm.DateTime.valueProp=olympe.dm.DateTime.P.la('ff023000000000000029');w('olympe.dm.DateTime.valueProp',olympe.dm.DateTime.valueProp);olympe.dm.DateTime.prototype.getValue.L=new olympe.D.J(()=>olympe.D.fb,[]);olympe.dm.Enum=class extends olympe.dm.String{na(){return olympe.D.va([super.na(),super.getValue()],(a,b)=>''!==a.valueOf()?a:b,olympe.D.Oa)}Wd(){return this.cd(olympe.dm.Enum.rankProp)}};olympe.dm.Enum.P=olympe.dc.oa.C('016cdd861b32d56c81f7',olympe.dm.Enum);olympe.dm.Enum.rankProp=olympe.dm.Enum.P.la('017a7690c915975ea995');olympe.dm.Enum.prototype.Wd.L=olympe.D.J.G;olympe.dm.Sf=class extends olympe.dm.BrickMetadata{zx(){return this.gb(olympe.dc.CloudObject.instancesRel).Jk(olympe.dm.Enum.rankProp,olympe.dc.query.Nj.ASC).nd()}static create(a,b){b=a.create(olympe.dm.Sf,(new Map).set(olympe.dc.CloudObject.nameProp,b));a.Ha(olympe.dc.CloudObject.extendRel,b,olympe.dm.Enum);return b}};olympe.dm.Sf.create=olympe.dm.Sf.create;olympe.dm.Sf.prototype.getValues=olympe.dm.Sf.prototype.zx;olympe.dm.Sf.P=olympe.dc.oa.C('017a768f966fc08ebb98',olympe.dm.Sf);olympe.dm.Number=class extends olympe.dm.xe{getValue(){return this.cd(olympe.dm.Number.valueProp)}Ac(){return this.get(olympe.dm.Number.valueProp)}};olympe.dm.Number.P=olympe.dc.oa.C('ff021000000000000013',olympe.dm.Number);olympe.dm.Number.valueProp=olympe.dm.Number.P.la('ff023000000000000028');w('olympe.dm.Number.valueProp',olympe.dm.Number.valueProp);olympe.dm.Number.prototype.getValue.L=olympe.D.J.G;olympe.sc={};olympe.sc.R={Ca:'sc.Logger',Uj:'sc.RootContext',ze:'sc.Serializer'};olympe.sc.U={Je:'sc.app',Nf:'sc.debug',un:'sc.autostartProfiler',qo:'sc.debugger',Xs:'sc.disableTheme',PRODUCTION:'sc.production',Au:'sc.onstartTimeout',yq:'sc.remoteActionTimeout'};
999
+ olympe.W.config(a=>{F(a,olympe.sc.U.Je,'');F(a,olympe.sc.U.Nf,!1);F(a,olympe.sc.U.Xs,!0);F(a,olympe.sc.U.PRODUCTION,!1);F(a,olympe.sc.U.Au,2E4);F(a,olympe.sc.U.yq,3E4);F(a,olympe.sc.U.un,!1);E(a,olympe.sc.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('sc'));D(a,olympe.sc.R.ze,olympe.sc.fc,olympe.dc.db.R.Ea);La(a,olympe.dc.sources.R.ze,olympe.sc.R.ze);E(a,olympe.sc.R.Uj,[new olympe.W.ja(olympe.sc.U.PRODUCTION)],b=>{const c=new olympe.sc.mg('root','root',null);olympe.sc.fn=c;c.set(olympe.sc.xa.C.PRODUCTION,b);return new olympe.sc.xa(c)})},
1000
+ 'olympe.sc');olympe.W.run([olympe.sc.R.Uj,new olympe.W.ja(olympe.N.U.al)],(a,b)=>{olympe.je().ctx=a;olympe.je().oVersion=()=>b});olympe.sc.Ym=()=>null!==olympe.dc.ia().Jb(void 0,olympe.sc.Runnable.C.cc());olympe.sc.kD=(a,b,c,d)=>{c=Z(Z(a.create(olympe.sc.Yc),olympe.sc.Yc.C,c||null),olympe.sc.Yc.G,d||null);a.Ha(olympe.sc.Yc.F,c,b);a.Ha(olympe.dc.CloudObject.containsRel,b,c);return c.X()};olympe.sc.Qi=(a,b)=>{a=olympe.dc.nb.Bw(b)(a);return a instanceof olympe.sc.Jd?a.C():a};
1001
+ olympe.sc.CD=function(a){const b=olympe.dc.CloudObject.containsRel.cc();var c=olympe.dc.ga(a);if(void 0===c)return[];a=olympe.dc.ia();const d=[];let e=[];const f=new Set;for(;!a.Sb(c,olympe.dm.Kb);){f.add(c);const g=a.Jb(c,b);if(null===g)return olympe.ma.hb('sc').warn(`Object ${c} has no container`),[];a.Sb(c,olympe.sc.logic.qb)||g===a.Jb(c,olympe.sc.Runnable.C.cc())||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.Rg(e[0],
1002
+ olympe.dm.Kb.Fa));e=e.concat(a.Rg(e[e.length-1],olympe.dm.Jc.Z.cc()));e=e.concat(a.Rg(e[e.length-1],olympe.dm.Jc.O.cc()));return[...d,...e].reverse()};olympe.sc.DD=a=>{a=a&&a.valueOf()||'';return a.startsWith('image/')?olympe.sc.rg:a.startsWith('video/')?olympe.sc.Dh:a.startsWith('font/')||a.startsWith('application/font-woff')?olympe.sc.Ic:olympe.dm.File};
1003
+ olympe.sc.BD=a=>a instanceof olympe.sc.rg?'image/*':a instanceof olympe.sc.Dh?'video/*':a instanceof olympe.sc.Ic?'font/*,application/font-woff':null;olympe.sc.Ya={};function pm(a,b){var c=olympe.sc.xa,d=a.C;a=a.F();b=olympe.dc.ga(b);let e,f=null==(e=d.F)?void 0:e.get(b);if(!f){f=d.Kh(a,void 0,b);for(d=f.getParent();d&&d.ka&&!d.id.startsWith('_');)d=d.getParent();let g;null==(g=d)||qm(g,b,f)}return new c(f)}function rm(a){let b;return null!=(b=a.Ma(olympe.sc.xa.C.PRODUCTION))?b:!1}
1004
+ olympe.sc.xa=class{constructor(a=olympe.sc.fn){this.C=a;this.H=olympe.ma.hb('sc');this.G=null}V(){return this.C.V()}getParent(){if(null===this.G){const a=this.C.getParent();this.G=null===a?null:new olympe.sc.xa(a)}return this.G}Cw(a){const b=olympe.dc.ia();let c=this.getParent();const d=e=>{if(e.ie()){const f=b.model(e.ie());if(f&&b.Ra(f,olympe.sc.Ua.ea)||a.modelTag&&!b.Sb(e.ie(),a.modelTag))return!1}return!0};for(;c&&!d(c);)c=c.getParent();return c}ie(){return this.C.ie()}F(){return this.C.C}set(a,
1003
1005
  b){this.C.set(a,b);return this}nn(a){return this.set(a,Date.now())}remove(a){this.set(a,null)}tb(a,b,c=!1){const d=olympe.dc.ga(a),e=olympe.D.ic(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.C.V():void 0));return e.tb()}get(a,b=!1){a=this.Ma(a,b);return void 0!==a?a:null}has(a,b=!1){return this.C.has(a,b)}observe(a,b=!0,c=!1){return new rxjs.Observable(d=>{const e=this.get(a);b||null!==e||d.next(e);const f=this.on(a,
1004
- d.next.bind(d),c?void 0:this.C.V(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=rm(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Zg(a.unsubscribe.bind(a));return this}zy(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Jh(`Runner ${a.name()}`);a.run(b);return b}ps(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.ga(a)})\``+
1005
- `on the context ${this.V()}:\nStack: ${this.me()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.V()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(a)})\` `+`has never received any value:\nStack: ${this.me()}`);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.me)?void 0:c.call(a))||this.me();let e,f;c=null!=(f=null==(e=a.Hr)?void 0:e.call(a))?f:0;b=sm(b,c,d);b.stack=a.stack}else b=
1006
- sm(b,0,this.me());tm(this.C,b);return this}By(a){this.set(olympe.sc.xa.C.kg,a);return this}Ma(a,b=!0){return this.C.Ma(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}Jh(a){return new olympe.sc.xa(this.C.Jh(this.F(),a))}Gk(a,b){return this.C.Gk(a,c=>{b(new olympe.sc.xa(c))})}hx(a){a=um(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}Zg(a,b){return this.C.Zg(a,b)}Ek(a){this.C.Ek(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.F().onDestroy(a)}Hf(a){this.eb()||this.F().Hf(a)}clear(){this.C.clear()}eb(){return this.F().eb()}Ra(a){a=
1007
- vm(this.C,a);return null!==a?new olympe.sc.ui.jz(a,this):null}Qw(a){a=vm(this.C,a);return null!==a?new olympe.sc.ui.iz(a,this):null}ey(...a){return rxjs.combineLatest(a.map(b=>{b=vm(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ga(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}me(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.C!==olympe.sc.fn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.je();return null!==
1008
- f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.V()}).join('\n> ')}catch(c){b=`No stack available for context ${this.V()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.ey;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.Qw;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Ra;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.eb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.Hf;
1009
- olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Ek;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.Zg;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.hx;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Gk;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.Jh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.By;
1010
- olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.ps;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.zy;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.nn;
1011
- olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.Bw;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',kg:'__htmlContainer',yz:'__dockableElement',sn:'__appHasStarted'};olympe.sc.hr=class extends olympe.sc.xa{constructor(a){super(a);this.J=new olympe.D.Zb('SC Update Context',super.F());const b=a.Zg(()=>{b&&a.Ek(b);this.J.destroy()})}F(){return this.J}Zg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.Mc())}};let wm=0;function rm(a,b){b=olympe.dc.ga(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.aa)?void 0:c.get('I#'+b))?e:null==(d=a.aa)?void 0:d.get('IO#'+b))?f:b}function tm(a,b){if(null===a.J)a.H.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ea){var c=xm(olympe.dc.CloudObject.get(a.ea));null!==c&&ym(a,c).some(d=>{let e,f;return 0<(null==(e=a.G)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.O.has('$'+c)?a.set(c,b):tm(a.J,b)}else tm(a.J,b)}
1012
- function um(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.J;a;){if(b===a.V()||a.T.has(b))return a;const c=zm(a.F,b);if(c)return c;a=a.getParent()}return null}function Am(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.V())||(a.Ya.set(b.V(),{Hk:b,depth:c}),Bm(a,d=>{(-1===b.G||c<b.G)&&Am(d,b,c+1)}),a.onDestroy(()=>{Cm(a,b.V())}));return b.V()}
1013
- function Cm(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {Hk:c,depth:d}=a.Ya.get(b);Bm(a,f=>{Cm(f,b)});0===d&&c.F();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.aa)?void 0:c.get('IO#'+b))||null}
1014
- function Dm(a){a.C.Z(()=>{Bm(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Ma(olympe.sc.xa.C.TRANSACTION,!1)&&a.H.warn(`The context ${a.V()} 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.F)||d.delete(a.V());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.T.clear()});let b;null==(b=a.J)||Em(b,a)}
1015
- 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.ka&&!c.id.startsWith('_')&&(a=zm(c.F,b)))return a;return null}function Fm(a,b,...c){if(null!==a.Ya)for(const {Hk:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function Gm(a,b){a.ea=olympe.dc.ga(b);a.ka=b.vd().Ym();b.G().forEach(c=>{a.id===c||a.T.has(c)||(a.T.add(c),pm(a,c,a))});a.aa=b.T();Fm(a,olympe.sc.Ya.oc.C.INIT)}function Hm(a){a.ua=!0;let b;null==(b=a.F)||b.forEach(c=>{Hm(c)})}
1016
- function Im(a){a.ua=!1;let b;null==(b=a.F)||b.forEach(c=>{Im(c)})}function ym(a,b){return['*',a.id,...a.T].map(c=>`${'@'}${c}.${b}`)}function Jm(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.F)||e.forEach(f=>{!f.ua&&f.data.has(b)||Jm(f,b,c,d)})}function Km(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));wm++;const e=wm;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}
1017
- function pm(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Bm(a,f=>{f.O.has(b)||pm(f,b,c)});a.O.delete(b)}function Bm(a,b){let c;null==(c=a.F)||c.forEach(b)}function Lm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Mm(a){var b=olympe.sc.Ya.oc.F.qf;const c=[];if(null!==a.Ya)for(const {Hk:d}of a.Ya.values())d.getType()===b&&(c.push(d.V()),d.F(),Cm(a,d.V()))}function Em(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
1018
- olympe.sc.mg=class{constructor(a,b='no name',c=olympe.sc.fn){this.id=a;this.md=b;this.T=new Set;this.J=c;this.C=new olympe.D.Zb('SC Context');this.data=new Map;this.ea=this.Z=this.F=this.G=null;this.ka=!1;this.O=new Set;this.ua=!1;this.aa=null;this.H=olympe.ma.gb('sc');this.Ya=null;Dm(this)}V(){return this.id}getParent(){return this.J}je(){return this.ea}set(a,b){if(!this.C.od()&&!this.C.eb()){const g=olympe.dc.ga(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.aa)?void 0:c.get('O#'+g))?h:null==
1019
- (d=this.aa)?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.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ga))try{var f=b.Ga(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&&Fm(this,olympe.sc.Ya.oc.C.Eg,a,b),f=ym(this,a),this.O.add(c),Jm(this,c,f,b),this.O.delete(c))}}on(a,b,c,d=!0){if(this.C.eb()||this.C.od())return()=>{};const e=rm(this,a),f=c?olympe.dc.ga(c):
1020
- '*';a=Km(this,'@'+f+'.'+e,b);c=c?(c=um(this,f))?c.Ma(e,!1):void 0:this.Ma(e);void 0!==c&&b(c);if(d)olympe.D.$a().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}Jh(a,b,c){const d=null!=c?c:'_'+olympe.Y.Mc();if(a.eb()||a.od())throw Error(`Try to create new child context in a destroyed context ${a.V()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.mg(d,
1021
- b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({Hk:f,depth:g})=>{(-1===f.G||g<f.G)&&Am(e,f,g+1)});return e}Gk(a,b){const c=um(this,a);if(c)return b(c),()=>{};const d=Km(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Ma(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.C.od()||this.C.eb()||(Fm(this,olympe.sc.Ya.oc.C.sj),this.C.destroy(),Fm(this,olympe.sc.Ya.oc.C.Pd))}Zg(a,b){if(this.C.eb())a();
1022
- else return wm++,b=null!=b?b:String(wm),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}Ek(a){null!==this.Z&&this.Z.delete(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.eb()){Fm(this,olympe.sc.Ya.oc.C.nj);let a;null==(a=this.Z)||a.forEach(b=>b());Fm(this,olympe.sc.Ya.oc.C.oj)}}eb(){return this.C.eb()}};olympe.sc.mg.prototype.getParent=olympe.sc.mg.prototype.getParent;olympe.sc.mg.C={Bl:'I#',Rl:'O#',rA:'IO#'};function Nm(a,b,c){return(c=c.je())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.oc=class{constructor(a=-1){this.id=olympe.Y.zf();this.active=!0;this.G=a}F(){this.active=!1}V(){return this.id}getType(){}process(){}};olympe.sc.Ya.oc.C={INIT:'INIT',Eg:'SET',nj:'CLEAR',oj:'CLEARED',sj:'DESTROY',Pd:'DESTROYED'};olympe.sc.Ya.oc.F={qf:'REMOTE',eu:'LOCAL',Sf:'PROFILER'};olympe.sc.Qd=class a{constructor(){this.F=this.J=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.pm(1E4);Xa(this.C,b=>{Mm(b)})}aa(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.Qd.C.Eu:c=this.G.get(e.f);b.qd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Qd.C.Fu:const h=f+c,k=(l,n,p=0)=>{Lm(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.je())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1023
- t])})};b.cn(h).then(()=>{const l=[];k(g,l,0);Bm(g,p=>{k(p,l,1)});olympe.N.yb.publish(h,{t:olympe.sc.Qd.C.yt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.Vu(h);Am(g,n);this.C.has(g)?Wa(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Qd.C.Gu:void 0!==g&&this.C.has(g)&&Wa(this.C,g);break;case olympe.sc.Qd.C.Qf:void 0!==g&&(this.C.delete(g),Mm(g))}}ea(b,c,d){this.O=new olympe.N.yb('discovery_debug_id',
1024
- c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Qd.C.Xs){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.zf(),f=new olympe.D.Zb(this.F,c.F()),this.J=new olympe.N.yb(this.F,f),this.J.listen().subscribe(g=>{this.aa(g,b,d)}));olympe.N.yb.publish(e,{t:olympe.sc.Qd.C.qs,n:olympe.W.getParameter(olympe.sc.U.qo)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
1025
- d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Bm(h,l=>{if(null!==l.je()){const n=olympe.dc.CloudObject.get(l.je()).pk(olympe.sc.Runnable.J).nd();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.V()]),this.T.set(l.V(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.N.yb.publish(b,{t:olympe.sc.Qd.C.gk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ma.gb('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
1026
- b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.ec();if(!c.Rb(d,olympe.sc.Dc))return b.toString();let f=`${b.Wb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).ag(olympe.dc.CloudObject.extendRel,!0).ge().fb(olympe.dc.CloudObject.propertyRel).ge().nd();e=olympe.dc.pa.from(e).ag(olympe.dc.CloudObject.extendRel,!0).ge().fb(olympe.dc.CloudObject.cj).ge().nd();d=d.filter(([g])=>g instanceof olympe.sc.Dc);0!==d.length&&(f+=
1027
- '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ra(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Dc);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Qd.J='discovery_debug_id';olympe.sc.Qd.C={Xs:0,qs:1,Eu:2,Fu:3,yt:4,gk:5,Gu:6,Qf:7};olympe.sc.Ya.AA=class extends olympe.sc.Ya.oc{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.Ya.oc.F.eu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.oc.C.Eg){a=Nm(c,rm(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};function Om(a,b,c,d=new Map){for(var e=[];b;){const n=b.je();if(!n)break;e.push(n);b=b.getParent()}cb(a.C,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.C;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.O.set(p,q);for(const [p,q]of c.entries())d.J.set(p,
1006
+ d.next.bind(d),c?void 0:this.C.V(),!1);this.onDestroy(()=>{f();d.complete()});return f})}repeat(a,b){const c=sm(this.C,a);a=b.subscribe(d=>{null!==d?this.set(c,d):this.remove(c)});this.Zg(a.unsubscribe.bind(a));return this}Ay(a){a=a instanceof olympe.sc.Runnable?a:this.get(a);if(!a)return null;const b=this.Kh(`Runner ${a.name()}`);a.run(b);return b}qs(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.ga(a)})\``+
1007
+ `on the context ${this.V()}:\nStack: ${this.le()}\n${f}`;f instanceof rxjs.EmptyError&&(g=`The context ${this.V()} has been destroyed while a Promise `+`created from a call to \`waitFor(${olympe.dc.ga(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.Ir)?void 0:e.call(a))?f:0;b=tm(b,c,d);b.stack=a.stack}else b=
1008
+ tm(b,0,this.le());um(this.C,b);return this}Cy(a){this.set(olympe.sc.xa.C.kg,a);return this}Ma(a,b=!0){return this.C.Ma(a,b)}on(a,b,c,d=!0){return this.C.on(a,b,c,d)}Kh(a){return new olympe.sc.xa(this.C.Kh(this.F(),a))}Gk(a,b){return this.C.Gk(a,c=>{b(new olympe.sc.xa(c))})}ix(a){a=vm(this.C,a);return a===this.C?this:a&&new olympe.sc.xa(a)}destroy(){this.C.destroy()}Zg(a,b){return this.C.Zg(a,b)}Ek(a){this.C.Ek(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.F().onDestroy(a)}If(a){this.eb()||this.F().If(a)}clear(){this.C.clear()}eb(){return this.F().eb()}Ra(a){a=
1009
+ wm(this.C,a);return null!==a?new olympe.sc.ui.kz(a,this):null}Rw(a){a=wm(this.C,a);return null!==a?new olympe.sc.ui.jz(a,this):null}gy(...a){return rxjs.combineLatest(a.map(b=>{b=wm(this.C,b);return null!==b?this.observe(b):rxjs.of(null)}))}Ga(a){return(null==a?void 0:a.constructor)!==this.constructor?!1:this.C===a.C}le(){const a=olympe.dc.ia();let b;try{const c=[this];let d=this.getParent();for(;null!==d&&d.C!==olympe.sc.fn;)c.push(d),d=d.getParent();b='> '+c.map(e=>{const f=e.ie();return null!==
1010
+ f?(e=a.model(f),`${a.name(f)||e&&a.name(e)||f} (${e})`):e.V()}).join('\n> ')}catch(c){b=`No stack available for context ${this.V()}: ${c}`,this.H.warn(b)}return b}};olympe.sc.xa.prototype.observeMany=olympe.sc.xa.prototype.gy;olympe.sc.xa.prototype.getEvent=olympe.sc.xa.prototype.Rw;olympe.sc.xa.prototype.getProperty=olympe.sc.xa.prototype.Ra;olympe.sc.xa.prototype.isDestroyed=olympe.sc.xa.prototype.eb;olympe.sc.xa.prototype.clear=olympe.sc.xa.prototype.clear;olympe.sc.xa.prototype.offDestroy=olympe.sc.xa.prototype.If;
1011
+ olympe.sc.xa.prototype.onDestroy=olympe.sc.xa.prototype.onDestroy;olympe.sc.xa.prototype.offClear=olympe.sc.xa.prototype.Ek;olympe.sc.xa.prototype.onClear=olympe.sc.xa.prototype.Zg;olympe.sc.xa.prototype.destroy=olympe.sc.xa.prototype.destroy;olympe.sc.xa.prototype.getOtherContext=olympe.sc.xa.prototype.ix;olympe.sc.xa.prototype.onContext=olympe.sc.xa.prototype.Gk;olympe.sc.xa.prototype.createChild=olympe.sc.xa.prototype.Kh;olympe.sc.xa.prototype.setParentElement=olympe.sc.xa.prototype.Cy;
1012
+ olympe.sc.xa.prototype['throw']=olympe.sc.xa.prototype.throw;olympe.sc.xa.prototype.waitFor=olympe.sc.xa.prototype.qs;olympe.sc.xa.prototype.runner=olympe.sc.xa.prototype.Ay;olympe.sc.xa.prototype.repeat=olympe.sc.xa.prototype.repeat;olympe.sc.xa.prototype.observe=olympe.sc.xa.prototype.observe;olympe.sc.xa.prototype.has=olympe.sc.xa.prototype.has;olympe.sc.xa.prototype.get=olympe.sc.xa.prototype.get;olympe.sc.xa.prototype.remove=olympe.sc.xa.prototype.remove;olympe.sc.xa.prototype.trigger=olympe.sc.xa.prototype.nn;
1013
+ olympe.sc.xa.prototype.set=olympe.sc.xa.prototype.set;olympe.sc.xa.prototype.getClosest=olympe.sc.xa.prototype.Cw;olympe.sc.xa.prototype.getParent=olympe.sc.xa.prototype.getParent;olympe.sc.xa.C={PRODUCTION:'__production',EDITION:'__editionMode',TRANSACTION:'__transaction',kg:'__htmlContainer',zz:'__dockableElement',sn:'__appHasStarted'};olympe.sc.ir=class extends olympe.sc.xa{constructor(a){super(a);this.K=new olympe.D.Zb('SC Update Context',super.F());const b=a.Zg(()=>{b&&a.Ek(b);this.K.destroy()})}F(){return this.K}Zg(a,b){return this.F().onDestroy(a,null!=b?b:olympe.Y.Nc())}};let xm=0;function sm(a,b){b=olympe.dc.ga(b);let c,d,e,f;return null!=(f=null!=(e=null==(c=a.aa)?void 0:c.get('I#'+b))?e:null==(d=a.aa)?void 0:d.get('IO#'+b))?f:b}function um(a,b){if(null===a.K)a.H.error(`An error occurred in a brick: ${b.toString()}`);else if(a.ea){var c=ym(olympe.dc.CloudObject.get(a.ea));null!==c&&zm(a,c).some(d=>{let e,f;return 0<(null==(e=a.G)?void 0:null==(f=e.get(d))?void 0:f.size)})&&!a.O.has('$'+c)?a.set(c,b):um(a.K,b)}else um(a.K,b)}
1014
+ function vm(a,b){if(b===a.id||a.T.has(b)||!b)return a;for(a=a.K;a;){if(b===a.V()||a.T.has(b))return a;const c=Am(a.F,b);if(c)return c;a=a.getParent()}return null}function Bm(a,b,c=0){null===a.Ya&&(a.Ya=new Map);a.Ya.has(b.V())||(a.Ya.set(b.V(),{Hk:b,depth:c}),Cm(a,d=>{(-1===b.G||c<b.G)&&Bm(d,b,c+1)}),a.onDestroy(()=>{Dm(a,b.V())}));return b.V()}
1015
+ function Dm(a,b){if(null===a.Ya||!a.Ya.has(b))return!1;const {Hk:c,depth:d}=a.Ya.get(b);Cm(a,f=>{Dm(f,b)});0===d&&c.F();const e=a.Ya.delete(b);0===a.Ya.size&&(a.Ya=null);return e}function wm(a,b){let c;return(null==(c=a.aa)?void 0:c.get('IO#'+b))||null}
1016
+ function Em(a){a.C.Z(()=>{Cm(a,c=>c.destroy())});a.C.onDestroy(()=>{void 0!==a.Ma(olympe.sc.xa.C.TRANSACTION,!1)&&a.H.warn(`The context ${a.V()} is being destroyed but still has unreleased transactions. You probably forgot to end a transaction.`);a.clear();let c;if(null!=(c=a.K)){let d;null==(d=c.F)||d.delete(a.V());let e;0===(null==(e=c.F)?void 0:e.size)&&(c.F=null)}a.T.clear()});let b;null==(b=a.K)||Fm(b,a)}
1017
+ function Am(a,b){if(null===a)return null;if(a.has(b))return a.get(b);for(const c of a.values())if(c.ka&&!c.id.startsWith('_')&&(a=Am(c.F,b)))return a;return null}function Gm(a,b,...c){if(null!==a.Ya)for(const {Hk:d,depth:e}of a.Ya.values())d.process(a,b,e,...c)}function Hm(a,b){a.ea=olympe.dc.ga(b);a.ka=b.vd().Ym();b.G().forEach(c=>{a.id===c||a.T.has(c)||(a.T.add(c),qm(a,c,a))});a.aa=b.T();Gm(a,olympe.sc.Ya.oc.C.INIT)}function Im(a){a.ua=!0;let b;null==(b=a.F)||b.forEach(c=>{Im(c)})}
1018
+ function Jm(a){a.ua=!1;let b;null==(b=a.F)||b.forEach(c=>{Jm(c)})}function zm(a,b){return['*',a.id,...a.T].map(c=>`${'@'}${c}.${b}`)}function Km(a,b,c,d){c.forEach(f=>{let g,h;null==(g=a.G)||null==(h=g.get(f))||h.forEach(k=>{k(d)})});let e;null==(e=a.F)||e.forEach(f=>{!f.ua&&f.data.has(b)||Km(f,b,c,d)})}function Lm(a,b,c){a.G||(a.G=new Map);let d=a.G.get(b);void 0===d&&(d=new Map,a.G.set(b,d));xm++;const e=xm;d.set(e,c);return()=>{const f=a.G.get(b);f&&(f.delete(e),0===f.size&&a.G.delete(b))}}
1019
+ function qm(a,b,c){a.O.add(b);let d,e;null==(d=a.G)||null==(e=d.get('&'+b))||e.forEach(f=>{f(c)});Cm(a,f=>{f.O.has(b)||qm(f,b,c)});a.O.delete(b)}function Cm(a,b){let c;null==(c=a.F)||c.forEach(b)}function Mm(a,b){a.data.forEach((c,d)=>b(c,d.slice(1)))}function Nm(a){var b=olympe.sc.Ya.oc.F.rf;const c=[];if(null!==a.Ya)for(const {Hk:d}of a.Ya.values())d.getType()===b&&(c.push(d.V()),d.F(),Dm(a,d.V()))}function Fm(a,b){null===a.F&&(a.F=new Map);a.F.set(b.id,b)}
1020
+ olympe.sc.mg=class{constructor(a,b='no name',c=olympe.sc.fn){this.id=a;this.md=b;this.T=new Set;this.K=c;this.C=new olympe.D.Zb('SC Context');this.data=new Map;this.ea=this.Z=this.F=this.G=null;this.ka=!1;this.O=new Set;this.ua=!1;this.aa=null;this.H=olympe.ma.hb('sc');this.Ya=null;Em(this)}V(){return this.id}getParent(){return this.K}ie(){return this.ea}set(a,b){if(!this.C.od()&&!this.C.eb()){const g=olympe.dc.ga(a);var c,d;let h,k;a=null!=(k=null!=(h=null==(c=this.aa)?void 0:c.get('O#'+g))?h:null==
1021
+ (d=this.aa)?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.O.has(c)){a:{if('function'===typeof(null==b?void 0:b.Ga))try{var f=b.Ga(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&&Gm(this,olympe.sc.Ya.oc.C.Eg,a,b),f=zm(this,a),this.O.add(c),Km(this,c,f,b),this.O.delete(c))}}on(a,b,c,d=!0){if(this.C.eb()||this.C.od())return()=>{};const e=sm(this,a),f=c?olympe.dc.ga(c):
1022
+ '*';a=Lm(this,'@'+f+'.'+e,b);c=c?(c=vm(this,f))?c.Ma(e,!1):void 0:this.Ma(e);void 0!==c&&b(c);if(d)olympe.D.$a().onDestroy(a);return a}has(a,b=!1){a='$'+sm(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}Kh(a,b,c){const d=null!=c?c:'_'+olympe.Y.Nc();if(a.eb()||a.od())throw Error(`Try to create new child context in a destroyed context ${a.V()}, probably because \`runner()\` is called on a destroyed context`);const e=a.run(()=>new olympe.sc.mg(d,
1023
+ b,this));null!==this.Ya&&0<this.Ya.size&&this.Ya.forEach(({Hk:f,depth:g})=>{(-1===f.G||g<f.G)&&Bm(e,f,g+1)});return e}Gk(a,b){const c=vm(this,a);if(c)return b(c),()=>{};const d=Lm(this,'&'+a,e=>{let f;null==(f=d)||f();b(e)});return d}Ma(a,b=!0){a='$'+sm(this,a);let c=this.data.get(a),d=this.getParent();if(b)for(;void 0===c&&null!==d;)c=d.data.get(a),d=d.getParent();return c}destroy(){this.C.od()||this.C.eb()||(Gm(this,olympe.sc.Ya.oc.C.sj),this.C.destroy(),Gm(this,olympe.sc.Ya.oc.C.Pd))}Zg(a,b){if(this.C.eb())a();
1024
+ else return xm++,b=null!=b?b:String(xm),null===this.Z&&(this.Z=new Map),this.Z.set(b,a),b;return b||'noId'}Ek(a){null!==this.Z&&this.Z.delete(a)}onDestroy(a){return this.eb()?(a(),'noId'):this.C.onDestroy(a)}clear(){if(!this.C.eb()){Gm(this,olympe.sc.Ya.oc.C.nj);let a;null==(a=this.Z)||a.forEach(b=>b());Gm(this,olympe.sc.Ya.oc.C.oj)}}eb(){return this.C.eb()}};olympe.sc.mg.prototype.getParent=olympe.sc.mg.prototype.getParent;olympe.sc.mg.C={Bl:'I#',Rl:'O#',sA:'IO#'};function Om(a,b,c){return(c=c.ie())?`${a}.${c}.${b}`:`${a}.${b}`}olympe.sc.Ya.oc=class{constructor(a=-1){this.id=olympe.Y.Af();this.active=!0;this.G=a}F(){this.active=!1}V(){return this.id}getType(){}process(){}};olympe.sc.Ya.oc.C={INIT:'INIT',Eg:'SET',nj:'CLEAR',oj:'CLEARED',sj:'DESTROY',Pd:'DESTROYED'};olympe.sc.Ya.oc.F={rf:'REMOTE',fu:'LOCAL',Tf:'PROFILER'};olympe.sc.Qd=class a{constructor(){this.F=this.K=this.O=null;this.T=new Map;this.G=new Map;this.C=new olympe.Y.pm(1E4);Xa(this.C,b=>{Nm(b)})}aa(b,c,d){const e=b.body(),f=e.c,g=this.T.get(f);switch(e.t){case olympe.sc.Qd.C.Fu:c=this.G.get(e.f);b.qd(c).catch(l=>{d.error('Unable to reply with paths: ',l)});break;case olympe.sc.Qd.C.Gu:const h=f+c,k=(l,n,p=0)=>{Mm(l,(q,r)=>{let t;q instanceof olympe.dc.CloudObject?t=a.G(q):t=q;let u;q=null!=(u=l.ie())?u:'';0<q.length&&(q+='.');n.push([`${p}.${q}${r}`,
1025
+ t])})};b.cn(h).then(()=>{const l=[];k(g,l,0);Cm(g,p=>{k(p,l,1)});olympe.N.yb.publish(h,{t:olympe.sc.Qd.C.zt,v:l,ts:0}).catch(p=>{d.error('Error publishing on service : ',p)});const n=new olympe.sc.Ya.Wu(h);Bm(g,n);this.C.has(g)?Wa(this.C,g):this.C.add(g)}).catch(l=>{d.error('Error notifying on a contextId : ',l)});break;case olympe.sc.Qd.C.Hu:void 0!==g&&this.C.has(g)&&Wa(this.C,g);break;case olympe.sc.Qd.C.Rf:void 0!==g&&(this.C.delete(g),Nm(g))}}ea(b,c,d){this.O=new olympe.N.yb('discovery_debug_id',
1026
+ c);this.O.listen().subscribe(e=>{var f=e.body();if(f.t===olympe.sc.Qd.C.Ys){e=f.i;f=f.f;if(!this.G.has(f)){const g=this.Z(f,c,b);if(0!==g.length)this.G.set(f,g);else return}null===this.F&&(this.F=olympe.Y.Af(),f=new olympe.D.Zb(this.F,c.F()),this.K=new olympe.N.yb(this.F,f),this.K.listen().subscribe(g=>{this.aa(g,b,d)}));olympe.N.yb.publish(e,{t:olympe.sc.Qd.C.rs,n:olympe.W.getParameter(olympe.sc.U.qo)||'no name',a:b,s:this.F}).catch(g=>{d.error('Error publishing on draw service : '+g)})}})}Z(b,c,
1027
+ d){const e=[],f=olympe.dc.ia(),g=(h,k)=>{Cm(h,l=>{if(null!==l.ie()){const n=olympe.dc.CloudObject.get(l.ie()).pk(olympe.sc.Runnable.K).nd();if(null!==n){const p=k+'/'+f.name(n);n.X()===b&&(e.push([p,l.V()]),this.T.set(l.V(),l));g(l,p)}}})};g(c.C,f.name(d));return e}static F(b,c,d){let e=d;d instanceof olympe.dc.CloudObject&&(e=a.G(d));olympe.N.yb.publish(b,{t:olympe.sc.Qd.C.gk,k:c,v:e,ts:Date.now()}).catch(f=>{olympe.ma.hb('Debugger').error('Error publishing on service : ',f)})}static G(b){if(null===
1028
+ b||void 0===b)return'<null>';const c=olympe.dc.ia();if(b instanceof olympe.dc.CloudObject){var d=b.ec();if(!c.Sb(d,olympe.sc.Ec))return b.toString();let f=`${b.Wb().name()} (${b.X()})`;var e=olympe.dc.CloudObject.get(d);d=olympe.dc.pa.from(e).ag(olympe.dc.CloudObject.extendRel,!0).fe().gb(olympe.dc.CloudObject.propertyRel).fe().nd();e=olympe.dc.pa.from(e).ag(olympe.dc.CloudObject.extendRel,!0).fe().gb(olympe.dc.CloudObject.cj).fe().nd();d=d.filter(([g])=>g instanceof olympe.sc.Ec);0!==d.length&&(f+=
1029
+ '<br> ',f+='Properties:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+' : '+c.Ra(b.X(),g)+'<br>'}));d=e.filter(([g])=>g instanceof olympe.sc.Ec);0!==d.length&&(f+=' ',f+='Relations:<br>',d.forEach(([,g])=>{f+=' ';f+=' - '+c.name(g)+'<br>'}));return f}return b.toString()}};olympe.sc.Qd.K='discovery_debug_id';olympe.sc.Qd.C={Ys:0,rs:1,Fu:2,Gu:3,zt:4,gk:5,Hu:6,Rf:7};olympe.sc.Ya.BA=class extends olympe.sc.Ya.oc{constructor(a=-1){super(a);this.C=new Map}getType(){return olympe.sc.Ya.oc.F.fu}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.oc.C.Eg){a=Om(c,sm(a,d[0]),a);d=d[1];let e;null==(e=this.C.get(a))||e(d)}}on(a,b){this.C.set(a,b)}};function Pm(a,b,c,d=new Map){for(var e=[];b;){const n=b.ie();if(!n)break;e.push(n);b=b.getParent()}cb(a.C,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.K.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.C;e=(new Map).set(c,h).set(k,l);c=(new Map).set(c,k);for(const [p,q]of e.entries())d.O.set(p,q);for(const [p,q]of c.entries())d.K.set(p,
1028
1030
  q)}}
1029
- olympe.sc.Ya.Nu=class extends olympe.sc.Ya.oc{constructor(a){super();this.C=a;this.ia=olympe.dc.ia();this.J=new Set}getType(){return olympe.sc.Ya.oc.F.Sf}process(a,b,c,...d){var e=Pm.Bl,f=Pm.Rl,g=Pm.Hu;const h=Pm.INIT,k=Pm.nj,l=Pm.oj,n=Pm.sj,p=Pm.Pd;c=Pm.Bu;if(b===olympe.sc.Ya.oc.C.Eg){const [q,r]=d;b=(d=a.je())?olympe.dc.ia().Rb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Rb(d,olympe.sc.ui.oB):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Rb(q,olympe.sc.logic.ub),d=this.ia.Rb(q,olympe.sc.logic.Bb),
1030
- Om(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Rb(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),Om(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.oc.C.INIT?Om(this,a,h):b===olympe.sc.Ya.oc.C.nj?Om(this,a,k):b===olympe.sc.Ya.oc.C.oj?Om(this,a,l):b===olympe.sc.Ya.oc.C.sj?Om(this,a,n):b===olympe.sc.Ya.oc.C.Pd&&Om(this,a,p)}};
1031
- const Pm={Bl:'input',Rl:'output',Hu:'prop',INIT:'init',nj:'clear',oj:'cleared',sj:'destroy',Pd:'destroyed',Bu:'other'};olympe.sc.Ya.Vu=class extends olympe.sc.Ya.oc{constructor(a){super(1);this.J=a;this.C=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.oc.F.qf}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.oc.C.Eg&&void 0!==d[0]&&null!==d[0]){const e=Nm(c,rm(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Wb()instanceof olympe.sc.Dc){const h=xg(this.db,f,()=>{olympe.sc.Qd.F(this.J,
1032
- e,f)});this.C.set(e,()=>{yg(this.db,f,h)})}olympe.sc.Qd.F(this.J,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{Rt(){return this.cd(this.Um())}St(){return this.cd(this.Vm())}uk(){return new olympe.D.Tb(this.cd(this.Um()),this.cd(this.Vm()))}Um(){}Vm(){}};olympe.sc.Metadata.P=olympe.dc.oa.C('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.Rt.L=olympe.D.K.G;m.St.L=olympe.D.K.G;m.uk.L=olympe.D.K.T;m.Um.L=olympe.D.K.C;m.Vm.L=olympe.D.K.C;olympe.sc.Yc=class extends olympe.dc.CloudObject{F(){return this.wb(olympe.sc.Yc.G)}C(){return this.wb(olympe.sc.Yc.C)}};olympe.sc.Yc.P=olympe.dc.oa.C('01703376c4a81c0e9d90',olympe.sc.Yc);olympe.sc.Yc.G=olympe.sc.Yc.P.la('01703376c4a81c0e9d91');olympe.sc.Yc.C=olympe.sc.Yc.P.la('01703376c4a81c0e9d92');olympe.sc.Yc.F=olympe.sc.Yc.P.ra('01703376c4a81c0e9d93');T(olympe.dc.CloudObject.P,olympe.sc.Yc.F);olympe.sc.Yc.prototype.F.L=olympe.D.K.F;olympe.sc.Yc.prototype.C.L=olympe.D.K.F;olympe.sc.zd={};olympe.sc.zd.Be={ht:'folders',Zu:'screenflow',yv:'ui-design',Rq:'software-intelligence',fh:'data-management',cB:'projects'};olympe.sc.jd=class extends olympe.dm.BrickMetadata{pe(){return olympe.sc.zd.Be.Rq}C(){return this.bb(olympe.sc.jd.C,olympe.sc.logic.uh)}F(){return this.bb(olympe.sc.jd.F,olympe.sc.logic.xg)}};olympe.sc.jd.P=olympe.dc.oa.C('011100000000000adef0',olympe.sc.jd);olympe.sc.jd.C=olympe.sc.jd.P.ra('016ac4f59a2917fdef01');olympe.sc.jd.F=olympe.sc.jd.P.ra('016ac4f59a2917fdef02');olympe.sc.jd.P.C=(a,b)=>dl(a,b||'New function signature',olympe.sc.jd,olympe.sc.logic.sd).X();
1033
- olympe.sc.jd.prototype.C.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.jd.prototype.F.L=new olympe.D.K(()=>olympe.dc.za,[]);function Qm(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Rm(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Rb(c,olympe.sc.logic.Sb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ra(c,olympe.sc.logic.Sb.C,!0))?e:0;let f;d=null!=(f=a.db.Ra(d,olympe.sc.logic.Sb.C,!0))?f:0;return c-d});return b}
1034
- olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Ut(a,b,c,d,e=!0){e||olympe.ma.gb('sc').error('parameter own= false ignored, investigate');return olympe.D.$g(L(this.Df(a,olympe.dc.nb.Qi,c)),d)}ox(){return this.bb(olympe.sc.Ua.O,olympe.sc.Runnable)}Ew(){return this.bb(olympe.sc.Ua.Z,olympe.sc.Runnable)}an(){return this.db.Ra(this,olympe.sc.Ua.ea)}Ym(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.C.cc())}Tt(){return this.bb(olympe.sc.Ua.G,olympe.sc.logic.ub)}xp(){return this.bb(olympe.sc.Ua.F,
1031
+ olympe.sc.Ya.Ou=class extends olympe.sc.Ya.oc{constructor(a){super();this.C=a;this.ia=olympe.dc.ia();this.K=new Set}getType(){return olympe.sc.Ya.oc.F.Tf}process(a,b,c,...d){var e=Qm.Bl,f=Qm.Rl,g=Qm.Iu;const h=Qm.INIT,k=Qm.nj,l=Qm.oj,n=Qm.sj,p=Qm.Pd;c=Qm.Cu;if(b===olympe.sc.Ya.oc.C.Eg){const [q,r]=d;b=(d=a.ie())?olympe.dc.ia().Sb(d,olympe.sc.logic.Function):!1;d=d?olympe.dc.ia().Sb(d,olympe.sc.ui.pB):!1;b?(g=this.ia.Jb(q,olympe.dm.Property.typeRel),b=this.ia.Sb(q,olympe.sc.logic.ub),d=this.ia.Sb(q,olympe.sc.logic.Bb),
1032
+ Pm(this,a,b?e:d?f:c,new Map([['propId',q],['value',r],['type',g]]))):d&&(e=this.ia.Sb(q,olympe.dm.Property),f=this.ia.Jb(q,olympe.dm.Property.typeRel),Pm(this,a,e?g:c,new Map([['propId',q],['value',r],['type',f]])))}else b===olympe.sc.Ya.oc.C.INIT?Pm(this,a,h):b===olympe.sc.Ya.oc.C.nj?Pm(this,a,k):b===olympe.sc.Ya.oc.C.oj?Pm(this,a,l):b===olympe.sc.Ya.oc.C.sj?Pm(this,a,n):b===olympe.sc.Ya.oc.C.Pd&&Pm(this,a,p)}};
1033
+ const Qm={Bl:'input',Rl:'output',Iu:'prop',INIT:'init',nj:'clear',oj:'cleared',sj:'destroy',Pd:'destroyed',Cu:'other'};olympe.sc.Ya.Wu=class extends olympe.sc.Ya.oc{constructor(a){super(1);this.K=a;this.C=new Map;this.db=olympe.dc.ia()}getType(){return olympe.sc.Ya.oc.F.rf}F(){super.F();for(const a of this.C.values())a();this.C.clear()}process(a,b,c,...d){if(this.active&&b===olympe.sc.Ya.oc.C.Eg&&void 0!==d[0]&&null!==d[0]){const e=Om(c,sm(a,d[0]),a),f=d[1];let g;null==(g=this.C.get(e))||g();this.C.delete(e);if(f instanceof olympe.dc.CloudObject&&f.Wb()instanceof olympe.sc.Ec){const h=xg(this.db,f,()=>{olympe.sc.Qd.F(this.K,
1034
+ e,f)});this.C.set(e,()=>{yg(this.db,f,h)})}olympe.sc.Qd.F(this.K,e,f)}}};olympe.sc.Metadata=class extends olympe.dc.CloudObject{St(){return this.cd(this.Um())}Tt(){return this.cd(this.Vm())}uk(){return new olympe.D.Ub(this.cd(this.Um()),this.cd(this.Vm()))}Um(){}Vm(){}};olympe.sc.Metadata.P=olympe.dc.oa.C('0161ae936c62f9fcd131',olympe.sc.Metadata);m=olympe.sc.Metadata.prototype;m.St.L=olympe.D.J.G;m.Tt.L=olympe.D.J.G;m.uk.L=olympe.D.J.T;m.Um.L=olympe.D.J.C;m.Vm.L=olympe.D.J.C;olympe.sc.Yc=class extends olympe.dc.CloudObject{F(){return this.wb(olympe.sc.Yc.G)}C(){return this.wb(olympe.sc.Yc.C)}};olympe.sc.Yc.P=olympe.dc.oa.C('01703376c4a81c0e9d90',olympe.sc.Yc);olympe.sc.Yc.G=olympe.sc.Yc.P.la('01703376c4a81c0e9d91');olympe.sc.Yc.C=olympe.sc.Yc.P.la('01703376c4a81c0e9d92');olympe.sc.Yc.F=olympe.sc.Yc.P.ra('01703376c4a81c0e9d93');T(olympe.dc.CloudObject.P,olympe.sc.Yc.F);olympe.sc.Yc.prototype.F.L=olympe.D.J.F;olympe.sc.Yc.prototype.C.L=olympe.D.J.F;olympe.sc.zd={};olympe.sc.zd.Be={it:'folders',$u:'screenflow',zv:'ui-design',Sq:'software-intelligence',fh:'data-management',dB:'projects'};olympe.sc.jd=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.zd.Be.Sq}C(){return this.bb(olympe.sc.jd.C,olympe.sc.logic.vh)}F(){return this.bb(olympe.sc.jd.F,olympe.sc.logic.xg)}};olympe.sc.jd.P=olympe.dc.oa.C('011100000000000adef0',olympe.sc.jd);olympe.sc.jd.C=olympe.sc.jd.P.ra('016ac4f59a2917fdef01');olympe.sc.jd.F=olympe.sc.jd.P.ra('016ac4f59a2917fdef02');olympe.sc.jd.P.C=(a,b)=>el(a,b||'New function signature',olympe.sc.jd,olympe.sc.logic.sd).X();
1035
+ olympe.sc.jd.prototype.C.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.sc.jd.prototype.F.L=new olympe.D.J(()=>olympe.dc.za,[]);function Rm(a,b){[].forEach(c=>c.call(a,b,(d,e)=>{null===e?b.remove(d):b.set(d,e)}))}function Sm(a,b){b=b.filter(c=>'string'===typeof c&&a.db.Sb(c,olympe.sc.logic.Tb));b.sort((c,d)=>{let e;c=null!=(e=a.db.Ra(c,olympe.sc.logic.Tb.C,!0))?e:0;let f;d=null!=(f=a.db.Ra(d,olympe.sc.logic.Tb.C,!0))?f:0;return c-d});return b}
1036
+ olympe.sc.Ua=class extends olympe.dm.BrickMetadata{Vt(a,b,c,d,e=!0){e||olympe.ma.hb('sc').error('parameter own= false ignored, investigate');return olympe.D.$g(L(this.Ef(a,olympe.dc.nb.Qi,c)),d)}px(){return this.bb(olympe.sc.Ua.O,olympe.sc.Runnable)}Fw(){return this.bb(olympe.sc.Ua.Z,olympe.sc.Runnable)}an(){return this.db.Ra(this,olympe.sc.Ua.ea)}Ym(){return null!==this.db.Jb(this.tag,olympe.sc.Runnable.C.cc())}Ut(){return this.bb(olympe.sc.Ua.G,olympe.sc.logic.ub)}yp(){return this.bb(olympe.sc.Ua.F,
1035
1037
  olympe.sc.logic.Bb)}G(){return[olympe.sc.Ua.kb]}};olympe.sc.Ua.P=olympe.dc.oa.C('0112000000000000def0',olympe.sc.Ua);olympe.sc.Ua.ea=olympe.sc.Ua.P.la('01692aa71f3108454479');olympe.sc.Ua.vb=olympe.sc.Ua.P.la('0166446c1f128ebc903a');olympe.sc.Ua.kb=olympe.sc.Ua.P.la('0166446c1f128ebc904e');olympe.sc.Ua.O=olympe.sc.Ua.P.ra('01692a4af82e8984742c');olympe.sc.Ua.Z=olympe.sc.Ua.P.ra('01692a4af82e8984742d');olympe.sc.Ua.aa=olympe.sc.Ua.P.ra('01692a4af82e8984742e');olympe.sc.Ua.G=olympe.sc.Ua.P.ra('01621fb84e320000f00a');
1036
- olympe.sc.Ua.F=olympe.sc.Ua.P.ra('01621fb84e320000f00b');olympe.sc.Ua.Bc=olympe.sc.Ua.P.ra('0171838bcfed0000e00e');olympe.sc.Ua.hc=olympe.sc.Ua.P.ra('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Ut.L=olympe.D.K.C;m.ox.L=new olympe.D.K(()=>olympe.dc.za,[]);m.Ew.L=new olympe.D.K(()=>olympe.dc.za,[]);m.an.L=olympe.D.K.C;m.Ym.L=olympe.D.K.C;m.Tt.L=new olympe.D.K(()=>olympe.dc.za,[]);m.xp.L=new olympe.D.K(()=>olympe.dc.za,[]);function xm(a){let b;return null!=(b=a.vd().G().map(olympe.dc.ga)[0])?b:null}function Sm(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ma.gb('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.D.$a().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.ob()});return c}
1037
- function Tm(a,b){Gm(b.C,a);Qm(a.vd(),b);const c=a.O(),d=Um(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.aa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Vm(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])})}
1038
- function Wm(a,b){var c=a.ec();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.eb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.hr(b.C);l.F().run(()=>v(function*(){try{yield a.update(l,k,g)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.H.debug(e):a.H.debug(f),h=>b.throw(h),()=>a.H.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
1039
- function Xm(a,b,c,d){const e=V(a.db,b,c,(f,g)=>{const h=om(d,g);f?olympe.dc.CloudObject.get(g).run(h):h.destroy()});d.F().onDestroy(a.db.F.bind(a.db,b,c,e,!0))}function Um(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)}})}
1040
- function Vm(a,b,c,d){b=b.F();const e=xg(a.db,a.tag,b.G((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.nb.zc(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{yg(a.db,a.tag,e)})}
1041
- olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{Tm(this,a);this.init(a);a.Zg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));if(this.vd().an())Wm(this,a);else{const b=new olympe.sc.hr(a.C);this.update(b,[],[])}this.F(a)})}vd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.vd();if(d.an())this.onUpdate(a,b,c);else this.H.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.V()}`),
1042
- Xm(this,d,olympe.sc.Ua.O,a),this.ka()&&Xm(this,d,olympe.sc.Ua.aa,a)}F(a){a.nn(olympe.sc.Ua.vb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.ec(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.H.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(){var a=
1043
- this.vd();return Rm(a,a.db.bb(a.tag,olympe.sc.Ua.G))}getOutputs(){var a=this.vd();return Rm(a,a.db.bb(a.tag,olympe.sc.Ua.F))}G(){return[]}T(){return new Map}ka(){return!1}J(a,b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.D.$g(a,d);return a}kb(a,b,c,d,e){olympe.D.en([d],f=>{b.set(a,olympe.D.Wr(f)?f.valueOf():f)});return this.J(a,b,c,e)}O(){return[this.ea,this.aa]}ea(a,b){Vm(this,a,b,null)}aa(a,b){Vm(this,a,null,b)}vb(a,b){const c=this.db,d=olympe.sc.logic.qb.G.cc(),e=olympe.sc.logic.qb.F,f=olympe.sc.logic.qb.C;
1044
- this.Gr(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return Ym(g,a,b.bind(null,h))})}};olympe.sc.Runnable.P=Af(olympe.dc.oa.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.J=olympe.sc.Runnable.P.ra('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.P.ra('01756a18d4921c103111');olympe.sc.Runnable.O=T(olympe.sc.Runnable.P,olympe.sc.Ua.O);olympe.sc.Runnable.T=T(olympe.sc.Runnable.P,olympe.sc.Ua.Z);olympe.sc.Runnable.Z=T(olympe.sc.Runnable.P,olympe.sc.Ua.aa);
1045
- T(olympe.sc.Ua.P,olympe.sc.Runnable.J);T(olympe.sc.Ua.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.vd.L=new olympe.D.K(()=>olympe.sc.Ua,[]);olympe.sc.Runnable.prototype.J.L=new olympe.D.K(()=>Object,[]);olympe.sc.Runnable.prototype.kb.L=olympe.D.K.C;function Zm(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Jd)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Jd=class extends olympe.dc.CloudObject{F(){return this.db.bb(this,olympe.sc.Jd.C)[0]}C(){const a=Zm(this);return olympe.dc.CloudObject.get(a)}zc(){return this.C().zc()}toString(){const a=Zm(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Jd.P=olympe.dc.oa.C('0163c9ae01f2d6e9ca49',olympe.sc.Jd);
1046
- olympe.sc.Jd.C=olympe.sc.Jd.P.ra('0169b5a8a33144fb0b49');T(olympe.dc.CloudObject.P,olympe.sc.Jd.C);olympe.sc.Jd.prototype.F.L=new olympe.D.K(()=>String,[]);olympe.sc.Jd.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.wo=class extends olympe.dm.Kb{pe(){return olympe.sc.zd.Be.fh}};olympe.sc.wo.P=olympe.dc.oa.C('0163a68ce44f3d1fa84c',olympe.sc.wo);olympe.sc.Dc=class extends olympe.dm.BrickMetadata{};olympe.sc.Dc.P=olympe.dc.oa.C('016324fde11a836f76c2',olympe.sc.Dc);olympe.sc.Dc.C=olympe.sc.Dc.P.ra('016324fde11a836087c2');olympe.sc.Dc.P.C=function(a,b){return dl(a,null!=b?b:'New type',olympe.sc.Dc).X()};let $m=null,an=null;
1047
- function bn(a,b,c){$m=a;const d=olympe.D.$a(),e=d.G(c);olympe.dc.hd.from(a).fb(olympe.sc.qa.Rc.C).fb(olympe.sc.Xc.C.cc()).ob({Ih:'__code-as-data__'}).then(f=>{an=f;if(null!==f)if(b){var g=olympe.dc.ia();Jh(d,f,h=>{h=g.Sh(h)?h:g.model(h);return null!==h&&g.Rb(h,olympe.sc.Dc)},{kn:!0}).subscribe(rxjs.Subscriber.create(()=>{e(olympe.sc.Xc.Lb.Bp)},()=>{olympe.ma.gb('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');e(olympe.sc.Xc.Lb.ti)}))}else olympe.ma.gb('sc').info("Found business container but won't load it's content according to configuration."),e(olympe.sc.Xc.Lb.ti);
1048
- else olympe.ma.gb('sc').info(`No business container for application ${a}. You probably miss permissions.`),e(olympe.sc.Xc.Lb.ti)}).catch(f=>{olympe.ma.gb('sc').error('Error while loading business container:',f.message);e(olympe.sc.Xc.Lb.zb)})}olympe.sc.Xc=class extends olympe.dc.CloudObject{};olympe.sc.Xc.Lb={Bp:0,ti:1,zb:2};olympe.sc.Xc.P=olympe.dc.oa.C('017b3aa8fae1e3d044dc',olympe.sc.Xc);olympe.sc.Xc.C=olympe.sc.Xc.P.ra('017b3aa8fd1659291b92');olympe.sc.Xc.F=olympe.sc.Xc.P.ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.oa.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.vg=class extends olympe.sc.Map{};olympe.sc.vg.P=olympe.dc.oa.C('01631aacd8276ea98490',olympe.sc.vg);olympe.sc.File=class extends olympe.dm.File{static cw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.hs(a,e,b,c,d);return e}static dw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.jn(a,e,b,c,d);return e}static hs(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.jn(a,b,c,d,e)}static jn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ia(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Ef(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1049
- 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.Ra(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.bs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.jn;olympe.sc.File.setContent=olympe.sc.File.hs;olympe.sc.File.createFromURL=olympe.sc.File.dw;olympe.sc.File.createFromContent=olympe.sc.File.cw;
1050
- olympe.sc.File.P=uf(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.rg=class extends olympe.sc.File{J(){const a=olympe.D.ic(olympe.D.Oa);this.sk(b=>{a.update(olympe.D.Ab(b))});return a.tb()}};olympe.sc.rg.P=uf(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.rg);olympe.sc.rg.P.C=olympe.sc.File.F.bind(null,olympe.sc.rg);olympe.sc.rg.prototype.J.L=olympe.D.K.F;olympe.sc.Ic=class extends olympe.sc.File{J(){return this.wb(olympe.sc.Ic.fontFamilyProp)}O(){return this.wb(olympe.sc.Ic.G)}T(){return this.cd(olympe.sc.Ic.J)}};olympe.sc.Ic.P=uf(olympe.sc.File,'01647e113043c637b541',olympe.sc.Ic);olympe.sc.Ic.fontFamilyProp=olympe.sc.Ic.P.la('01647e35ecd24ef0b88d');olympe.sc.Ic.G=olympe.sc.Ic.P.la('01647e677f5d1cfbdf42');olympe.sc.Ic.J=olympe.sc.Ic.P.la('01647e6780999bf8bd25');
1051
- olympe.sc.Ic.P.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.Ic,a,b,c,d);a.update(c,olympe.sc.Ic.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Ic.prototype.J.L=olympe.D.K.F;olympe.sc.Ic.prototype.O.L=olympe.D.K.F;olympe.sc.Ic.prototype.T.L=olympe.D.K.G;olympe.sc.Ch=class extends olympe.sc.File{};olympe.sc.Ch.P=uf(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Ch);olympe.sc.Ch.P.C=olympe.sc.File.F.bind(null,olympe.sc.Ch);olympe.sc.jr=class extends olympe.dc.CloudObject{};olympe.sc.jr.P=olympe.dc.oa.C('016421bb3797e22d1c4e',olympe.sc.jr);olympe.sc.logic={};olympe.sc.logic.ap=(a,b)=>a===b?0:a>b?1:-1;
1052
- olympe.sc.logic.zA=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Ma(b.getType().X());let k,l;if(b===olympe.dc.ga(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.ga(olympe.dm.Number))k=c.valueOf(),l=p=>p.cd(h);else if(b===olympe.dc.ga(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.va([p.Xi(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);
1053
- return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.ap(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.ap(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.kk().filter(p=>olympe.D.va([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Xb(d.valueOf()?1===q:0<=q)},olympe.D.fa,'FilterList ListDefBuilder Filter TransformFlows')).ri())};
1054
- olympe.sc.logic.iD=(a,b)=>{if(a instanceof olympe.D.ba)return a;if(a instanceof olympe.D.Oa)return a.ls();if(a instanceof olympe.D.fa)return a.Rr();if('string'===typeof a||'number'===typeof a)return olympe.D.sa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ba.Kp};olympe.sc.logic.Na={};function cn(a){zf(a.P,(b,c)=>{b=b.create(a.P.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Na.Qo=class{constructor(a,b,c){this.P=olympe.dc.oa.C(a,b,...c);cn(this)}X(){return this.P.X()}};olympe.sc.logic.Na.Qo.ya=[olympe.dc.Ne];const dn=Object.create(null),en=new Map;function fn(a){if(void 0===dn[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return wf(a)}function gn(a,b,c=olympe.sc.logic.Function){if(en.has(a))throw c=fn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.oa.C(a,b,...[]);en.set(a,{P:d,yD:b,fD:c});return d}
1055
- olympe.sc.logic.oa=class{constructor(){}static C(a,b,...c){if(dn[a])throw c=fn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Na.Qo(a,b,[olympe.sc.R.Ca].concat(c));return dn[a]=b}};olympe.sc.logic.mz=class{};olympe.sc.logic.qj=class extends olympe.dc.CloudObject{};olympe.sc.logic.qj.P=olympe.dc.oa.C('01621fb84e320000cf00',olympe.sc.logic.qj);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.C=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}$w(){return this.message}Hr(){return this.code}me(){let a;return null!=(a=this.C)?a:''}toString(){return`${this.message}\nError found in:\n${this.me()}\n\n${this.stack}`}};olympe.sc.logic.Error.prototype.getStack=olympe.sc.logic.Error.prototype.me;
1056
- olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Hr;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.$w;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.gi=class extends olympe.sc.logic.qj{};olympe.sc.logic.gi.P=olympe.dc.oa.C('016eeb5ede9f3094d8f0',olympe.sc.logic.gi);olympe.sc.logic.gd=class extends olympe.dc.CloudObject{C(){return this.qc(olympe.sc.logic.gd.C,olympe.dc.CloudObject)}};olympe.sc.logic.gd.P=olympe.dc.oa.C('016ac4f59ee8ea2081ba',olympe.sc.logic.gd);olympe.sc.logic.gd.F=olympe.sc.logic.gd.P.la('017bc044aeacce7ffc8f');olympe.sc.logic.gd.C=olympe.sc.logic.gd.P.ra('016ac4f5a0091c4790e2');T(olympe.dc.CloudObject.P,olympe.sc.logic.gd.C);olympe.sc.logic.gd.prototype.C.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.uh=class extends olympe.sc.logic.gd{};olympe.sc.logic.uh.P=olympe.dc.oa.C('016ac4f59c592b862457',olympe.sc.logic.uh);olympe.sc.logic.uh.G=olympe.sc.jd.C.cc();olympe.sc.logic.uh.P.C=(a,b,c,d,e)=>{b=dl(a,b||'New Predefined Input',olympe.sc.logic.uh,olympe.sc.logic.ub);Z(b,olympe.sc.logic.gd.F,e);a.Ha(olympe.sc.logic.gd.C,b,c);a.Ha(olympe.sc.jd.C,d,b);return b.X()};olympe.sc.logic.xg=class extends olympe.sc.logic.gd{};olympe.sc.logic.xg.P=olympe.dc.oa.C('016ac4f59dd99f5df3e1',olympe.sc.logic.xg);olympe.sc.logic.xg.G=T(olympe.sc.logic.xg.P,olympe.sc.jd.F);olympe.sc.logic.xg.P.C=(a,b,c,d,e)=>{b=dl(a,b||'New Predefined Output',olympe.sc.logic.xg,olympe.sc.logic.Bb);Z(b,olympe.sc.logic.gd.F,e);a.Ha(olympe.sc.logic.gd.C,b,c);a.Ha(olympe.sc.jd.F,d,b);return b.X()};olympe.sc.logic.sd=class extends olympe.sc.Ua{pe(){return olympe.sc.zd.Be.Rq}Z(){return this.Pm().kk().Rb([olympe.sc.logic.Function]).and().pd().Rb([olympe.sc.logic.dd,olympe.sc.logic.ed]).ri()}G(){const a=olympe.dc.ga(olympe.sc.logic.gi);return this.db.bb(this,olympe.sc.logic.sd.F).filter(b=>this.db.Jb(b,olympe.sc.logic.Sb.typeRel)===a)}C(a){const b=this.db.Mm(this,[olympe.sc.Ua.G],c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}F(a){const b=this.db.Mm(this,[olympe.sc.Ua.F],
1057
- c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.sd.P=gn('01621fb84e320000f000',olympe.sc.logic.sd,olympe.sc.logic.Function);olympe.sc.logic.sd.prototype.C.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.sd.prototype.F.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Kf=class extends olympe.sc.logic.sd{J(){return this.C('016ac63229782039429f')}O(){return this.F('016ac6322acf67eebfe7')}T(){return this.xp().kk().fb(olympe.sc.logic.Sb.typeRel).zk(olympe.sc.logic.gi).ri().lf().Zm(olympe.D.ba.ZERO)}};olympe.sc.logic.Kf.C='016ac63229782039429f';olympe.sc.logic.Kf.J='016ac6322acf67eebfe7';olympe.sc.logic.Kf.P=gn('01621fb84e320000a000',olympe.sc.logic.Kf,olympe.sc.logic.Action);olympe.sc.logic.Kf.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);
1058
- olympe.sc.logic.Kf.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Kf.prototype.T.L=olympe.D.K.O;olympe.sc.logic.bo=class extends olympe.sc.logic.sd{};olympe.sc.logic.bo.P=gn('01621fb84e320000f011',olympe.sc.logic.bo);olympe.sc.logic.ao=class extends olympe.sc.logic.Kf{};olympe.sc.logic.ao.P=gn('01621fb84e320000f012',olympe.sc.logic.ao);olympe.sc.logic.Function=class extends olympe.sc.Runnable{O(){return[this.vb]}T(){const a=olympe.sc.mg.C.Bl,b=olympe.sc.mg.C.Rl,c=this.db,d=new Map,e=this.ec();c.bb(e,olympe.sc.Ua.G).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Ua.F).forEach(f=>{d.set(b+c.name(f),f)});return d}C(a){const b=olympe.dc.ga(olympe.sc.logic.qj),c=olympe.dc.ga(olympe.sc.logic.gi);return this.getOutputs().map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Sb.typeRel)){case b:return a.nn.bind(a,d);case c:return a.throw.bind(a);
1059
- default:return a.set.bind(a,d)}})}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.oa.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.Ca);olympe.sc.logic.Sb=class extends olympe.dc.CloudObject{getType(){return this.qc(olympe.sc.logic.Sb.typeRel,olympe.dc.CloudObject)}C(){return this.cd(olympe.sc.logic.Sb.C)}};olympe.sc.logic.Sb.P=olympe.dc.oa.C('0168a431d25001540000',olympe.sc.logic.Sb);olympe.sc.logic.Sb.C=olympe.sc.logic.Sb.P.la('01740c5d4ae4b520dd01');olympe.sc.logic.Sb.typeRel=olympe.sc.logic.Sb.P.ra('0168a431d3b9b7438424');T(olympe.dc.CloudObject.P,olympe.sc.logic.Sb.typeRel);
1060
- olympe.sc.logic.Sb.prototype.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Sb.prototype.C.L=olympe.D.K.G;olympe.sc.logic.ub=class extends olympe.sc.logic.Sb{};olympe.sc.logic.ub.P=olympe.dc.oa.C('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.T=olympe.sc.logic.Sb.P.la('01740c5d4ae4b520dd02');olympe.sc.logic.ub.O=T(olympe.sc.logic.ub.P,olympe.sc.Ua.G);olympe.sc.logic.ub.F=olympe.sc.logic.ub.P.ra('0168a431d91f2578000b',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.G=olympe.sc.logic.ub.P.ra('01621fb84e32000000a1',olympe.dc.wa.ORIGIN);
1061
- olympe.sc.logic.ub.J=olympe.sc.logic.ub.P.ra('01621fb84e32000000d1',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.P.C=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ha(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Sb.C,e);d&&a.Ha(olympe.sc.Ua.G,d,f);return f.X()};olympe.sc.logic.Bb=class extends olympe.sc.logic.Sb{};olympe.sc.logic.Bb.P=olympe.dc.oa.C('0168a431d25001540002',olympe.sc.logic.Bb);olympe.sc.logic.Bb.O=T(olympe.sc.logic.Bb.P,olympe.sc.Ua.F);olympe.sc.logic.Bb.F=olympe.sc.logic.Bb.P.ra('0168a431d91f25780003',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.J=olympe.sc.logic.Bb.P.ra('01621fb84e32000000a2',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.G=olympe.sc.logic.Bb.P.ra('01621fb84e32000000d2',olympe.dc.wa.ORIGIN);
1062
- olympe.sc.logic.Bb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.Bb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ha(olympe.sc.logic.Sb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Sb.C,e);d&&a.Ha(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.vd().J().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.oa.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){Tm(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.G),d=this.db.Jb(this,olympe.sc.logic.dd.F);a.on(c,e=>b.set(d,e),this.tag)}ua(){return this.qc(olympe.sc.logic.dd.G,olympe.sc.logic.ub)}Fa(){return this.qc(olympe.sc.logic.dd.F,olympe.sc.logic.Bb)}};olympe.sc.logic.dd.P=olympe.dc.oa.C('01621fb84e32000000a0',olympe.sc.logic.dd,olympe.sc.R.Ca);olympe.sc.logic.dd.G=T(olympe.sc.logic.dd.P,olympe.sc.logic.ub.G);
1063
- olympe.sc.logic.dd.F=T(olympe.sc.logic.dd.P,olympe.sc.logic.Bb.J);olympe.sc.logic.dd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Ha(olympe.sc.logic.dd.F,b,c);return b.X()};olympe.sc.logic.dd.prototype.ua.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.dd.prototype.Fa.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);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.F),d=this.db.Jb(this,olympe.sc.logic.ed.G);b.on(c,e=>a.set(d,e),b.V())}Fa(){return this.qc(olympe.sc.logic.ed.F,olympe.sc.logic.ub)}ua(){return this.qc(olympe.sc.logic.ed.G,olympe.sc.logic.Bb)}};olympe.sc.logic.ed.P=olympe.dc.oa.C('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.R.Ca);olympe.sc.logic.ed.F=T(olympe.sc.logic.ed.P,olympe.sc.logic.ub.J);
1064
- olympe.sc.logic.ed.G=T(olympe.sc.logic.ed.P,olympe.sc.logic.Bb.G);olympe.sc.logic.ed.P.C=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Ha(olympe.sc.logic.ed.F,b,c);return b.X()};olympe.sc.logic.ed.prototype.Fa.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ed.prototype.ua.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);function Ym(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.qb.T))?d:a.db.Jb(a,olympe.sc.logic.qb.J),f=a.db.Jb(a,olympe.sc.logic.qb.O);if(null!==e&&null!==f){d=a.db.Ef(hn(a),olympe.dm.ye)?new olympe.D.Zb('Pipe Context'):null;const k=a.C.bind(a,c,d);let l;const n=b.Gk(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.nb.zc(k)),h=vg(a.db,a,olympe.sc.logic.qb.valueProp,g);return()=>{g(null);wg(a.db,a,olympe.sc.logic.qb.valueProp,
1065
- h)}}function hn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.qb.F);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.qb.C))&&(b=a.db.Jb(c,olympe.sc.logic.Sb.typeRel));return b||olympe.dc.ga(olympe.dc.CloudObject)}
1066
- olympe.sc.logic.qb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.H=c}C(a,b,c){const d=olympe.sc.Qi(c);null==b||b.ka();b&&d instanceof olympe.dm.ye?null==b||b.run(()=>{olympe.D.Nc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Df(olympe.sc.logic.qb.valueProp,a||olympe.dc.nb.Qi,Object)}getType(){const a=this.transform(olympe.sc.logic.qb.C,olympe.sc.logic.Sb.typeRel);a.Hd(olympe.dc.CloudObject);return a.Gc()}vx(){return this.qc(olympe.sc.logic.qb.O,olympe.dc.CloudObject)}tx(){return this.qc(olympe.sc.logic.qb.T,
1067
- olympe.sc.logic.Bb)}ux(){return this.qc(olympe.sc.logic.qb.J,olympe.dm.Property)}Nw(){return this.qc(olympe.sc.logic.qb.G,olympe.dc.CloudObject)}Lw(){return this.qc(olympe.sc.logic.qb.C,olympe.sc.logic.ub)}Mw(){return this.qc(olympe.sc.logic.qb.F,olympe.dm.Property)}};olympe.sc.logic.qb.P=olympe.dc.oa.C('0168a431d91f25780000',olympe.sc.logic.qb,olympe.sc.R.Ca);olympe.sc.logic.qb.valueProp=olympe.sc.logic.qb.P.la('0168a431d91f25780001');olympe.sc.logic.qb.O=olympe.sc.logic.qb.P.ra('0168a431d91f25780002');
1068
- olympe.sc.logic.qb.T=T(olympe.sc.logic.qb.P,olympe.sc.logic.Bb.F);olympe.sc.logic.qb.J=olympe.sc.logic.qb.P.ra('0168a431d91f25780004');olympe.sc.logic.qb.G=olympe.sc.logic.qb.P.ra('0168a431d91f2578000a');olympe.sc.logic.qb.C=T(olympe.sc.logic.qb.P,olympe.sc.logic.ub.F);olympe.sc.logic.qb.F=olympe.sc.logic.qb.P.ra('0168a431d91f2578000c');T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.O);T(olympe.dm.Property.P,olympe.sc.logic.qb.J);T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.G);
1069
- T(olympe.dm.Property.P,olympe.sc.logic.qb.F);m=olympe.sc.logic.qb.prototype;m.getType.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.vx.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.tx.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.ux.L=new olympe.D.K(()=>olympe.dm.Property,[]);m.Nw.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);m.Lw.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Mw.L=new olympe.D.K(()=>olympe.dm.Property,[]);function jn(a,b){const c=a.vd(),d=c.Fl().X(),e=c.Gl().X(),f=c.Hl().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.N.yb.get(a.ec(),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.me()+'\n===== Remote Call =====\n'+b.me()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.H.error(k);b.throw(olympe.sc.logic.Error.create(k,
1038
+ olympe.sc.Ua.F=olympe.sc.Ua.P.ra('01621fb84e320000f00b');olympe.sc.Ua.Cc=olympe.sc.Ua.P.ra('0171838bcfed0000e00e');olympe.sc.Ua.hc=olympe.sc.Ua.P.ra('0171838bcfed0000a00a');m=olympe.sc.Ua.prototype;m.Vt.L=olympe.D.J.C;m.px.L=new olympe.D.J(()=>olympe.dc.za,[]);m.Fw.L=new olympe.D.J(()=>olympe.dc.za,[]);m.an.L=olympe.D.J.C;m.Ym.L=olympe.D.J.C;m.Ut.L=new olympe.D.J(()=>olympe.dc.za,[]);m.yp.L=new olympe.D.J(()=>olympe.dc.za,[]);function ym(a){let b;return null!=(b=a.vd().G().map(olympe.dc.ga)[0])?b:null}function Tm(a){const b=new olympe.dc.Wa;a=b.create(a);b.persist(a,!1);b.ob((d,e)=>{d||olympe.ma.hb('sc').error(`Error occurred for transaction executed by createLocalRunnable: ${e}`)});const c=olympe.dc.CloudObject.get(a);olympe.D.$a().onDestroy(()=>{const d=new olympe.dc.Wa;d.delete(c);d.ob()});return c}
1039
+ function Um(a,b){Hm(b.C,a);Rm(a.vd(),b);const c=a.O(),d=Vm(b,c),e=[];c.forEach((f,g)=>{f===a.ea?e[0]=g:f===a.aa&&(e[1]=g)});void 0!==e[0]&&void 0!==e[1]&&(Wm(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])})}
1040
+ function Xm(a,b){var c=a.ec();const d=a.db.name(c),e=`Brick ${d} successfully run`,f=`Brick ${d} successfully cleared`,g=a.C(b);c=a.setupExecution(b).pipe(rxjs.operators.map(h=>{if(!b.eb()&&(b.clear(),null!==h)){const k=Array.isArray(h)?h:[h],l=new olympe.sc.ir(b.C);l.F().run(()=>v(function*(){try{yield a.update(l,k,g)}catch(n){l.throw(n)}}));return!0}return!1})).subscribe(rxjs.Subscriber.create(h=>h?a.H.debug(e):a.H.debug(f),h=>b.throw(h),()=>a.H.debug(`Brick ${d} completed`)));b.onDestroy(c.unsubscribe.bind(c))}
1041
+ function Ym(a,b,c,d){const e=V(a.db,b,c,(f,g)=>{const h=pm(d,g);f?olympe.dc.CloudObject.get(g).run(h):h.destroy()});d.F().onDestroy(a.db.F.bind(a.db,b,c,e,!0))}function Vm(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)}})}
1042
+ function Wm(a,b,c,d){b=b.F();const e=xg(a.db,a.tag,b.G((f,g,h)=>{const k=h?d:c;null!==k&&(k(f,olympe.dc.nb.Ac(g)),h&&c!==k&&(null==c||c(f,null)))}));b.onDestroy(()=>{yg(a.db,a.tag,e)})}
1043
+ olympe.sc.Runnable=class extends olympe.dm.BrickMetadata{constructor(a,b,c){super(a,b);this.H=c}run(a){a.F().run(()=>{Um(this,a);this.init(a);a.Zg(this.clear.bind(this,a));a.onDestroy(this.destroy.bind(this,a));if(this.vd().an())Xm(this,a);else{const b=new olympe.sc.ir(a.C);this.update(b,[],[])}this.F(a)})}vd(){return this.Wb()}init(a){this.onInit(a)}update(a,b,c){const d=this.vd();if(d.an())this.onUpdate(a,b,c);else this.H.debug(`Softcoded runnable ${this.db.name(this)} with tag ${this.tag} running in context ${a.V()}`),
1044
+ Ym(this,d,olympe.sc.Ua.O,a),this.ka()&&Ym(this,d,olympe.sc.Ua.aa,a)}F(a){a.nn(olympe.sc.Ua.vb)}clear(){}destroy(a){this.onDestroy(a)}setupExecution(){return rxjs.of([])}C(){return[]}onInit(){}onUpdate(){const a=this.ec(),b=this.db.name(a),c=this.db.name(this.db.model(a));this.H.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(){var a=
1045
+ this.vd();return Sm(a,a.db.bb(a.tag,olympe.sc.Ua.G))}getOutputs(){var a=this.vd();return Sm(a,a.db.bb(a.tag,olympe.sc.Ua.F))}G(){return[]}T(){return new Map}ka(){return!1}K(a,b,c,d){a=b.tb(a,c,!0);void 0!==d&&olympe.D.$g(a,d);return a}kb(a,b,c,d,e){olympe.D.en([d],f=>{b.set(a,olympe.D.Xr(f)?f.valueOf():f)});return this.K(a,b,c,e)}O(){return[this.ea,this.aa]}ea(a,b){Wm(this,a,b,null)}aa(a,b){Wm(this,a,null,b)}vb(a,b){const c=this.db,d=olympe.sc.logic.qb.G.cc(),e=olympe.sc.logic.qb.F,f=olympe.sc.logic.qb.C;
1046
+ this.Hr(d,g=>{var h=g.X();if(h=c.Jb(h,e)||c.Jb(h,f))return Zm(g,a,b.bind(null,h))})}};olympe.sc.Runnable.P=Af(olympe.dc.oa.C('01130000000000ca1100',olympe.sc.Runnable));olympe.sc.Runnable.K=olympe.sc.Runnable.P.ra('01692a4af82e8984742b');olympe.sc.Runnable.C=olympe.sc.Runnable.P.ra('01756a18d4921c103111');olympe.sc.Runnable.O=T(olympe.sc.Runnable.P,olympe.sc.Ua.O);olympe.sc.Runnable.T=T(olympe.sc.Runnable.P,olympe.sc.Ua.Z);olympe.sc.Runnable.Z=T(olympe.sc.Runnable.P,olympe.sc.Ua.aa);
1047
+ T(olympe.sc.Ua.P,olympe.sc.Runnable.K);T(olympe.sc.Ua.P,olympe.sc.Runnable.C);olympe.sc.Runnable.prototype.vd.L=new olympe.D.J(()=>olympe.sc.Ua,[]);olympe.sc.Runnable.prototype.K.L=new olympe.D.J(()=>Object,[]);olympe.sc.Runnable.prototype.kb.L=olympe.D.J.C;function $m(a){if(a){if('string'===typeof a)return a;if(a instanceof olympe.sc.Jd)return(a=a.F())?a.valueOf():null;if('function'===typeof a.X)return a.X()}return null}olympe.sc.Jd=class extends olympe.dc.CloudObject{F(){return this.db.bb(this,olympe.sc.Jd.C)[0]}C(){const a=$m(this);return olympe.dc.CloudObject.get(a)}Ac(){return this.C().Ac()}toString(){const a=$m(this);let b;a&&(b=this.db.name(a));return b||super.toString()}};olympe.sc.Jd.P=olympe.dc.oa.C('0163c9ae01f2d6e9ca49',olympe.sc.Jd);
1048
+ olympe.sc.Jd.C=olympe.sc.Jd.P.ra('0169b5a8a33144fb0b49');T(olympe.dc.CloudObject.P,olympe.sc.Jd.C);olympe.sc.Jd.prototype.F.L=new olympe.D.J(()=>String,[]);olympe.sc.Jd.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.wo=class extends olympe.dm.Kb{oe(){return olympe.sc.zd.Be.fh}};olympe.sc.wo.P=olympe.dc.oa.C('0163a68ce44f3d1fa84c',olympe.sc.wo);olympe.sc.Ec=class extends olympe.dm.BrickMetadata{};olympe.sc.Ec.P=olympe.dc.oa.C('016324fde11a836f76c2',olympe.sc.Ec);olympe.sc.Ec.C=olympe.sc.Ec.P.ra('016324fde11a836087c2');olympe.sc.Ec.P.C=function(a,b){return el(a,null!=b?b:'New type',olympe.sc.Ec).X()};let an=null,bn=null;
1049
+ function cn(a,b,c){an=a;const d=olympe.D.$a(),e=d.G(c);olympe.dc.hd.from(a).gb(olympe.sc.qa.Sc.C).gb(olympe.sc.Xc.C.cc()).ob({Jh:'__code-as-data__'}).then(f=>{bn=f;if(null!==f)if(b){var g=olympe.dc.ia();Jh(d,f,h=>{h=g.Th(h)?h:g.model(h);return null!==h&&g.Sb(h,olympe.sc.Ec)},{kn:!0}).subscribe(rxjs.Subscriber.create(()=>{e(olympe.sc.Xc.Lb.Cp)},()=>{olympe.ma.hb('sc').error('Impossible to load the business container for the application',a,'maybe are you offline?');e(olympe.sc.Xc.Lb.vi)}))}else olympe.ma.hb('sc').info("Found business container but won't load it's content according to configuration."),e(olympe.sc.Xc.Lb.vi);
1050
+ else olympe.ma.hb('sc').info(`No business container for application ${a}. You probably miss permissions.`),e(olympe.sc.Xc.Lb.vi)}).catch(f=>{olympe.ma.hb('sc').error('Error while loading business container:',f.message);e(olympe.sc.Xc.Lb.zb)})}olympe.sc.Xc=class extends olympe.dc.CloudObject{};olympe.sc.Xc.Lb={Cp:0,vi:1,zb:2};olympe.sc.Xc.P=olympe.dc.oa.C('017b3aa8fae1e3d044dc',olympe.sc.Xc);olympe.sc.Xc.C=olympe.sc.Xc.P.ra('017b3aa8fd1659291b92');olympe.sc.Xc.F=olympe.sc.Xc.P.ra('017b3aa8fe7ec3fd52f2');olympe.sc.Map=class extends olympe.dc.CloudObject{};olympe.sc.Map.P=olympe.dc.oa.C('018119241abce0e5696e',olympe.sc.Map);olympe.sc.vg=class extends olympe.sc.Map{};olympe.sc.vg.P=olympe.dc.oa.C('01631aacd8276ea98490',olympe.sc.vg);olympe.sc.File=class extends olympe.dm.File{static dw(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.js(a,e,b,c,d);return e}static ew(a,b,c,d,e,f){e=a.create(olympe.sc.File,new Map,e,f);olympe.sc.File.jn(a,e,b,c,d);return e}static js(a,b,c,d,e){e=null!=e?e:'application/data';d=URL.createObjectURL(new Blob([d],{type:e}));olympe.sc.File.jn(a,b,c,d,e)}static jn(a,b,c,d,e){const f=olympe.dc.ia(),g=f.Ia(b);var h;const k=null!=(h=a.model(b))?h:olympe.sc.File;if(null===k||!f.Ff(k,olympe.dm.File))throw Error(`Try to set the content of an object which is not a file: ${b}`);
1051
+ 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.Ra(b,olympe.dm.File.urlProp)||c.set(olympe.dm.File.creationDateProp,h).set(olympe.dm.File.C,!1);a.cs(b,c)}};olympe.sc.File.setURLContent=olympe.sc.File.jn;olympe.sc.File.setContent=olympe.sc.File.js;olympe.sc.File.createFromURL=olympe.sc.File.ew;olympe.sc.File.createFromContent=olympe.sc.File.dw;
1052
+ olympe.sc.File.P=uf(olympe.dm.File,'ff021000000000000031',olympe.sc.File);olympe.sc.rg=class extends olympe.sc.File{K(){const a=olympe.D.ic(olympe.D.Oa);this.sk(b=>{a.update(olympe.D.Ab(b))});return a.tb()}};olympe.sc.rg.P=uf(olympe.sc.File,'01644b6297305d62fca2',olympe.sc.rg);olympe.sc.rg.P.C=olympe.sc.File.F.bind(null,olympe.sc.rg);olympe.sc.rg.prototype.K.L=olympe.D.J.F;olympe.sc.Ic=class extends olympe.sc.File{K(){return this.wb(olympe.sc.Ic.fontFamilyProp)}O(){return this.wb(olympe.sc.Ic.G)}T(){return this.cd(olympe.sc.Ic.K)}};olympe.sc.Ic.P=uf(olympe.sc.File,'01647e113043c637b541',olympe.sc.Ic);olympe.sc.Ic.fontFamilyProp=olympe.sc.Ic.P.la('01647e35ecd24ef0b88d');olympe.sc.Ic.G=olympe.sc.Ic.P.la('01647e677f5d1cfbdf42');olympe.sc.Ic.K=olympe.sc.Ic.P.la('01647e6780999bf8bd25');
1053
+ olympe.sc.Ic.P.C=(a,b,c,d)=>{c=olympe.sc.File.F(olympe.sc.Ic,a,b,c,d);a.update(c,olympe.sc.Ic.fontFamilyProp,b.split('.')[0]);return c};olympe.sc.Ic.prototype.K.L=olympe.D.J.F;olympe.sc.Ic.prototype.O.L=olympe.D.J.F;olympe.sc.Ic.prototype.T.L=olympe.D.J.G;olympe.sc.Dh=class extends olympe.sc.File{};olympe.sc.Dh.P=uf(olympe.sc.File,'0164643c432146a71d5c',olympe.sc.Dh);olympe.sc.Dh.P.C=olympe.sc.File.F.bind(null,olympe.sc.Dh);olympe.sc.kr=class extends olympe.dc.CloudObject{};olympe.sc.kr.P=olympe.dc.oa.C('016421bb3797e22d1c4e',olympe.sc.kr);olympe.sc.logic={};olympe.sc.logic.ap=(a,b)=>a===b?0:a>b?1:-1;
1054
+ olympe.sc.logic.AA=(a,b,c,d,e,f,g)=>{const h=b.X();b=olympe.D.Ma(b.getType().X());let k,l;if(b===olympe.dc.ga(olympe.dm.String))k=c.valueOf().toLowerCase(),l=p=>p.wb(h).toLowerCase();else if(b===olympe.dc.ga(olympe.dm.Number))k=c.valueOf(),l=p=>p.cd(h);else if(b===olympe.dc.ga(olympe.dm.DateTime))k=c.getTime(),l=p=>olympe.D.va([p.Xi(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);
1055
+ return}let n;if('<'===f)n=(p,q)=>olympe.sc.logic.ap(q,p);else if('>'===f)n=(p,q)=>olympe.sc.logic.ap(p,q);else{g.error(`Unknown inequality ${f}. Please use '<' or '>'`);return}e(a.kk().filter(p=>olympe.D.va([l(p)],q=>{q=n(q.valueOf(),k);return olympe.D.Xb(d.valueOf()?1===q:0<=q)},olympe.D.fa,'FilterList ListDefBuilder Filter TransformFlows')).si())};
1056
+ olympe.sc.logic.jD=(a,b)=>{if(a instanceof olympe.D.ba)return a;if(a instanceof olympe.D.Oa)return a.ms();if(a instanceof olympe.D.fa)return a.Sr();if('string'===typeof a||'number'===typeof a)return olympe.D.sa(Number(a));b.error(`Could not parse provided value ${a} into a number`);return olympe.D.ba.Lp};olympe.sc.logic.Na={};function dn(a){zf(a.P,(b,c)=>{b=b.create(a.P.F);Z(b,olympe.dc.CloudObject.nameProp,c);return b.X()})}olympe.sc.logic.Na.Qo=class{constructor(a,b,c){this.P=olympe.dc.oa.C(a,b,...c);dn(this)}X(){return this.P.X()}};olympe.sc.logic.Na.Qo.ya=[olympe.dc.Ne];const en=Object.create(null),fn=new Map;function gn(a){if(void 0===en[a])throw Error(`Tag: ${a} - does not correspond to a registered function`);return wf(a)}function hn(a,b,c=olympe.sc.logic.Function){if(fn.has(a))throw c=gn(a),Error(`Tag: ${a} - overwriting existing function definition "${c.name}" with "${b.name}"`);const d=olympe.dc.oa.C(a,b,...[]);fn.set(a,{P:d,zD:b,gD:c});return d}
1057
+ olympe.sc.logic.oa=class{constructor(){}static C(a,b,...c){if(en[a])throw c=gn(a),Error(`Tag: ${a} - overwriting already defined function "${c.name}" with "${b.name}"`);b=new olympe.sc.logic.Na.Qo(a,b,[olympe.sc.R.Ca].concat(c));return en[a]=b}};olympe.sc.logic.nz=class{};olympe.sc.logic.qj=class extends olympe.dc.CloudObject{};olympe.sc.logic.qj.P=olympe.dc.oa.C('01621fb84e320000cf00',olympe.sc.logic.qj);function tm(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.C=null!=c?c:null}static create(a,b){return new olympe.sc.logic.Error(a,b)}ax(){return this.message}Ir(){return this.code}le(){let a;return null!=(a=this.C)?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;
1058
+ olympe.sc.logic.Error.prototype.getCode=olympe.sc.logic.Error.prototype.Ir;olympe.sc.logic.Error.prototype.getMessage=olympe.sc.logic.Error.prototype.ax;olympe.sc.logic.Error.create=olympe.sc.logic.Error.create;olympe.sc.logic.hi=class extends olympe.sc.logic.qj{};olympe.sc.logic.hi.P=olympe.dc.oa.C('016eeb5ede9f3094d8f0',olympe.sc.logic.hi);olympe.sc.logic.gd=class extends olympe.dc.CloudObject{C(){return this.qc(olympe.sc.logic.gd.C,olympe.dc.CloudObject)}};olympe.sc.logic.gd.P=olympe.dc.oa.C('016ac4f59ee8ea2081ba',olympe.sc.logic.gd);olympe.sc.logic.gd.F=olympe.sc.logic.gd.P.la('017bc044aeacce7ffc8f');olympe.sc.logic.gd.C=olympe.sc.logic.gd.P.ra('016ac4f5a0091c4790e2');T(olympe.dc.CloudObject.P,olympe.sc.logic.gd.C);olympe.sc.logic.gd.prototype.C.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.vh=class extends olympe.sc.logic.gd{};olympe.sc.logic.vh.P=olympe.dc.oa.C('016ac4f59c592b862457',olympe.sc.logic.vh);olympe.sc.logic.vh.G=olympe.sc.jd.C.cc();olympe.sc.logic.vh.P.C=(a,b,c,d,e)=>{b=el(a,b||'New Predefined Input',olympe.sc.logic.vh,olympe.sc.logic.ub);Z(b,olympe.sc.logic.gd.F,e);a.Ha(olympe.sc.logic.gd.C,b,c);a.Ha(olympe.sc.jd.C,d,b);return b.X()};olympe.sc.logic.xg=class extends olympe.sc.logic.gd{};olympe.sc.logic.xg.P=olympe.dc.oa.C('016ac4f59dd99f5df3e1',olympe.sc.logic.xg);olympe.sc.logic.xg.G=T(olympe.sc.logic.xg.P,olympe.sc.jd.F);olympe.sc.logic.xg.P.C=(a,b,c,d,e)=>{b=el(a,b||'New Predefined Output',olympe.sc.logic.xg,olympe.sc.logic.Bb);Z(b,olympe.sc.logic.gd.F,e);a.Ha(olympe.sc.logic.gd.C,b,c);a.Ha(olympe.sc.jd.F,d,b);return b.X()};olympe.sc.logic.sd=class extends olympe.sc.Ua{oe(){return olympe.sc.zd.Be.Sq}Z(){return this.Pm().kk().Sb([olympe.sc.logic.Function]).and().pd().Sb([olympe.sc.logic.dd,olympe.sc.logic.ed]).si()}G(){const a=olympe.dc.ga(olympe.sc.logic.hi);return this.db.bb(this,olympe.sc.logic.sd.F).filter(b=>this.db.Jb(b,olympe.sc.logic.Tb.typeRel)===a)}C(a){const b=this.db.Mm(this,[olympe.sc.Ua.G],c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}F(a){const b=this.db.Mm(this,[olympe.sc.Ua.F],
1059
+ c=>this.db.model(c)===olympe.dc.ga(a));return b?olympe.dc.CloudObject.get(b):null}};olympe.sc.logic.sd.P=hn('01621fb84e320000f000',olympe.sc.logic.sd,olympe.sc.logic.Function);olympe.sc.logic.sd.prototype.C.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.sd.prototype.F.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Lf=class extends olympe.sc.logic.sd{K(){return this.C('016ac63229782039429f')}O(){return this.F('016ac6322acf67eebfe7')}T(){return this.yp().kk().gb(olympe.sc.logic.Tb.typeRel).zk(olympe.sc.logic.hi).si().lf().Zm(olympe.D.ba.ZERO)}};olympe.sc.logic.Lf.C='016ac63229782039429f';olympe.sc.logic.Lf.K='016ac6322acf67eebfe7';olympe.sc.logic.Lf.P=hn('01621fb84e320000a000',olympe.sc.logic.Lf,olympe.sc.logic.Action);olympe.sc.logic.Lf.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);
1060
+ olympe.sc.logic.Lf.prototype.O.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Lf.prototype.T.L=olympe.D.J.O;olympe.sc.logic.bo=class extends olympe.sc.logic.sd{};olympe.sc.logic.bo.P=hn('01621fb84e320000f011',olympe.sc.logic.bo);olympe.sc.logic.ao=class extends olympe.sc.logic.Lf{};olympe.sc.logic.ao.P=hn('01621fb84e320000f012',olympe.sc.logic.ao);olympe.sc.logic.Function=class extends olympe.sc.Runnable{O(){return[this.vb]}T(){const a=olympe.sc.mg.C.Bl,b=olympe.sc.mg.C.Rl,c=this.db,d=new Map,e=this.ec();c.bb(e,olympe.sc.Ua.G).forEach(f=>{d.set(a+c.name(f),f)});c.bb(e,olympe.sc.Ua.F).forEach(f=>{d.set(b+c.name(f),f)});return d}C(a){const b=olympe.dc.ga(olympe.sc.logic.qj),c=olympe.dc.ga(olympe.sc.logic.hi);return this.getOutputs().map(d=>{switch(this.db.Jb(d,olympe.sc.logic.Tb.typeRel)){case b:return a.nn.bind(a,d);case c:return a.throw.bind(a);
1061
+ default:return a.set.bind(a,d)}})}setupExecution(a){const b=this.getInputs();return 0<b.length?rxjs.combineLatest(b.map(c=>a.observe(c))).pipe(rxjs.operators.map(c=>c.includes(null)?null:c)):rxjs.of([])}};olympe.sc.logic.Function.P=olympe.dc.oa.C('0168c6f020f2a96f0000',olympe.sc.logic.Function,olympe.sc.R.Ca);olympe.sc.logic.Tb=class extends olympe.dc.CloudObject{getType(){return this.qc(olympe.sc.logic.Tb.typeRel,olympe.dc.CloudObject)}C(){return this.cd(olympe.sc.logic.Tb.C)}};olympe.sc.logic.Tb.P=olympe.dc.oa.C('0168a431d25001540000',olympe.sc.logic.Tb);olympe.sc.logic.Tb.C=olympe.sc.logic.Tb.P.la('01740c5d4ae4b520dd01');olympe.sc.logic.Tb.typeRel=olympe.sc.logic.Tb.P.ra('0168a431d3b9b7438424');T(olympe.dc.CloudObject.P,olympe.sc.logic.Tb.typeRel);
1062
+ olympe.sc.logic.Tb.prototype.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);olympe.sc.logic.Tb.prototype.C.L=olympe.D.J.G;olympe.sc.logic.ub=class extends olympe.sc.logic.Tb{};olympe.sc.logic.ub.P=olympe.dc.oa.C('0168a431d25001540001',olympe.sc.logic.ub);olympe.sc.logic.ub.T=olympe.sc.logic.Tb.P.la('01740c5d4ae4b520dd02');olympe.sc.logic.ub.O=T(olympe.sc.logic.ub.P,olympe.sc.Ua.G);olympe.sc.logic.ub.F=olympe.sc.logic.ub.P.ra('0168a431d91f2578000b',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.G=olympe.sc.logic.ub.P.ra('01621fb84e32000000a1',olympe.dc.wa.ORIGIN);
1063
+ olympe.sc.logic.ub.K=olympe.sc.logic.ub.P.ra('01621fb84e32000000d1',olympe.dc.wa.ORIGIN);olympe.sc.logic.ub.P.C=function(a,b,c,d,e,f=olympe.sc.logic.ub){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New input');a.Ha(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ha(olympe.sc.Ua.G,d,f);return f.X()};olympe.sc.logic.Bb=class extends olympe.sc.logic.Tb{};olympe.sc.logic.Bb.P=olympe.dc.oa.C('0168a431d25001540002',olympe.sc.logic.Bb);olympe.sc.logic.Bb.O=T(olympe.sc.logic.Bb.P,olympe.sc.Ua.F);olympe.sc.logic.Bb.F=olympe.sc.logic.Bb.P.ra('0168a431d91f25780003',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.K=olympe.sc.logic.Bb.P.ra('01621fb84e32000000a2',olympe.dc.wa.ORIGIN);olympe.sc.logic.Bb.G=olympe.sc.logic.Bb.P.ra('01621fb84e32000000d2',olympe.dc.wa.ORIGIN);
1064
+ olympe.sc.logic.Bb.P.C=function(a,b,c,d,e,f=olympe.sc.logic.Bb){f=a.create(f);Z(f,olympe.dc.CloudObject.nameProp,b||'New output');a.Ha(olympe.sc.logic.Tb.typeRel,f,c);void 0!==e&&Z(f,olympe.sc.logic.Tb.C,e);d&&a.Ha(olympe.sc.Ua.F,d,f);return f.X()};olympe.sc.logic.Action=class extends olympe.sc.logic.Function{setupExecution(a){const b=this.vd().K().X();return a.observe(b).pipe(rxjs.operators.map(c=>null===c?null:this.getInputs().filter(d=>d!==b).map(d=>a.get(d))))}};olympe.sc.logic.Action.P=olympe.dc.oa.C('0168c6f020f2a96a0000',olympe.sc.logic.Action,olympe.sc.R.Ca);olympe.sc.logic.dd=class extends olympe.sc.logic.Function{run(a){Um(this,a);const b=a.getParent(),c=this.db.Jb(this,olympe.sc.logic.dd.G),d=this.db.Jb(this,olympe.sc.logic.dd.F);a.on(c,e=>b.set(d,e),this.tag)}ua(){return this.qc(olympe.sc.logic.dd.G,olympe.sc.logic.ub)}Fa(){return this.qc(olympe.sc.logic.dd.F,olympe.sc.logic.Bb)}};olympe.sc.logic.dd.P=olympe.dc.oa.C('01621fb84e32000000a0',olympe.sc.logic.dd,olympe.sc.R.Ca);olympe.sc.logic.dd.G=T(olympe.sc.logic.dd.P,olympe.sc.logic.ub.G);
1065
+ olympe.sc.logic.dd.F=T(olympe.sc.logic.dd.P,olympe.sc.logic.Bb.K);olympe.sc.logic.dd.P.C=function(a,b,c){b=a.create(olympe.sc.logic.dd);a.Ha(olympe.sc.logic.dd.F,b,c);return b.X()};olympe.sc.logic.dd.prototype.ua.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.dd.prototype.Fa.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);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.F),d=this.db.Jb(this,olympe.sc.logic.ed.G);b.on(c,e=>a.set(d,e),b.V())}Fa(){return this.qc(olympe.sc.logic.ed.F,olympe.sc.logic.ub)}ua(){return this.qc(olympe.sc.logic.ed.G,olympe.sc.logic.Bb)}};olympe.sc.logic.ed.P=olympe.dc.oa.C('01621fb84e32000000d0',olympe.sc.logic.ed,olympe.sc.R.Ca);olympe.sc.logic.ed.F=T(olympe.sc.logic.ed.P,olympe.sc.logic.ub.K);
1066
+ olympe.sc.logic.ed.G=T(olympe.sc.logic.ed.P,olympe.sc.logic.Bb.G);olympe.sc.logic.ed.P.C=function(a,b,c){b=a.create(olympe.sc.logic.ed);a.Ha(olympe.sc.logic.ed.F,b,c);return b.X()};olympe.sc.logic.ed.prototype.Fa.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.ed.prototype.ua.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);function Zm(a,b,c){var d;const e=null!=(d=a.db.Jb(a,olympe.sc.logic.qb.T))?d:a.db.Jb(a,olympe.sc.logic.qb.K),f=a.db.Jb(a,olympe.sc.logic.qb.O);if(null!==e&&null!==f){d=a.db.Ff(jn(a),olympe.dm.xe)?new olympe.D.Zb('Pipe Context'):null;const k=a.C.bind(a,c,d);let l;const n=b.Gk(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.nb.Ac(k)),h=vg(a.db,a,olympe.sc.logic.qb.valueProp,g);return()=>{g(null);wg(a.db,a,olympe.sc.logic.qb.valueProp,
1067
+ h)}}function jn(a){let b=null,c=a.db.Jb(a,olympe.sc.logic.qb.F);c?b=a.db.Jb(c,olympe.dm.Property.typeRel):(c=a.db.Jb(a,olympe.sc.logic.qb.C))&&(b=a.db.Jb(c,olympe.sc.logic.Tb.typeRel));return b||olympe.dc.ga(olympe.dc.CloudObject)}
1068
+ olympe.sc.logic.qb=class extends olympe.dc.CloudObject{constructor(a,b,c){super(a,b);this.H=c}C(a,b,c){const d=olympe.sc.Qi(c);null==b||b.ka();b&&d instanceof olympe.dm.xe?null==b||b.run(()=>{olympe.D.Oc([d.getValue()],e=>{a(e.valueOf())})}):a(d)}getValue(a){return this.Ef(olympe.sc.logic.qb.valueProp,a||olympe.dc.nb.Qi,Object)}getType(){const a=this.transform(olympe.sc.logic.qb.C,olympe.sc.logic.Tb.typeRel);a.Hd(olympe.dc.CloudObject);return a.Gc()}wx(){return this.qc(olympe.sc.logic.qb.O,olympe.dc.CloudObject)}ux(){return this.qc(olympe.sc.logic.qb.T,
1069
+ olympe.sc.logic.Bb)}vx(){return this.qc(olympe.sc.logic.qb.K,olympe.dm.Property)}Ow(){return this.qc(olympe.sc.logic.qb.G,olympe.dc.CloudObject)}Mw(){return this.qc(olympe.sc.logic.qb.C,olympe.sc.logic.ub)}Nw(){return this.qc(olympe.sc.logic.qb.F,olympe.dm.Property)}};olympe.sc.logic.qb.P=olympe.dc.oa.C('0168a431d91f25780000',olympe.sc.logic.qb,olympe.sc.R.Ca);olympe.sc.logic.qb.valueProp=olympe.sc.logic.qb.P.la('0168a431d91f25780001');olympe.sc.logic.qb.O=olympe.sc.logic.qb.P.ra('0168a431d91f25780002');
1070
+ olympe.sc.logic.qb.T=T(olympe.sc.logic.qb.P,olympe.sc.logic.Bb.F);olympe.sc.logic.qb.K=olympe.sc.logic.qb.P.ra('0168a431d91f25780004');olympe.sc.logic.qb.G=olympe.sc.logic.qb.P.ra('0168a431d91f2578000a');olympe.sc.logic.qb.C=T(olympe.sc.logic.qb.P,olympe.sc.logic.ub.F);olympe.sc.logic.qb.F=olympe.sc.logic.qb.P.ra('0168a431d91f2578000c');T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.O);T(olympe.dm.Property.P,olympe.sc.logic.qb.K);T(olympe.dc.CloudObject.P,olympe.sc.logic.qb.G);
1071
+ T(olympe.dm.Property.P,olympe.sc.logic.qb.F);m=olympe.sc.logic.qb.prototype;m.getType.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.wx.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.ux.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);m.vx.L=new olympe.D.J(()=>olympe.dm.Property,[]);m.Ow.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);m.Mw.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);m.Nw.L=new olympe.D.J(()=>olympe.dm.Property,[]);function kn(a,b){const c=a.vd(),d=c.Fl().X(),e=c.Gl().X(),f=c.Hl().X();b.on(d,g=>{if(g){g=new Map(a.getInputs().map(k=>[k,b.get(k)]));const h={timeout:a.timeout};olympe.N.yb.get(a.ec(),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=tm(k.message,k.code,k.le()+'\n===== Remote Call =====\n'+b.le()),b.throw(k))}).catch(k=>{k=`RemoteAction "${a.Wb().name()}" (${a.tag}) encountered an error:\n${k}`;a.H.error(k);b.throw(olympe.sc.logic.Error.create(k,
1070
1072
  400))})}},b.V())}
1071
- function kn(a,b,c,d,e,f){const g=n=>v(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.qd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.ec()}): ${r}`);f.Lh(t).catch(u=>{a.H.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.ec()}): ${u}`)})}finally{b.destroy()}}}),h=b.V(),k=b.on(c,g,h),l=b.on(d,g,h)}
1072
- olympe.sc.logic.xh=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.Ma(olympe.sc.xa.C.EDITION))&&b||(this.db.Ra(this,olympe.sc.logic.xh.F)?this.ua(a):(Tm(this,a),jn(this,a)))}ua(a){const b=this.ec(),c=this.vd(),d=c.yp().X(),e=c.Fl().X(),f=c.Gl().X(),g=c.Hl().X();(new olympe.N.yb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Jh('remote call'),l=h.body(),n=jc(()=>{h.Lh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1073
- k.destroy()},this.timeout);kn(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.Wh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ga(q)!==p&&(q=this.ec(),this.H.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.ec();this.H.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1074
- 1))})},h=>{const k=this.ec();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.xh.P=olympe.dc.oa.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.xh,olympe.sc.R.Ca,new olympe.W.ja(olympe.sc.U.xq));olympe.sc.logic.xh.F=olympe.sc.logic.xh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Cl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Cl.C={pz:-1,qA:1};olympe.sc.logic.controllers.hB=class extends olympe.sc.logic.controllers.Cl{constructor(){super(olympe.sc.logic.gd.C)}};olympe.sc.logic.controllers.pB=class extends olympe.sc.logic.controllers.Cl{constructor(){super(olympe.sc.logic.Sb.typeRel)}};olympe.sc.logic.qk={};olympe.sc.logic.qk.nv=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ga(b);d?olympe.dc.pa.Pb(a,d,olympe.dc.Ob.Uf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.H.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.oa.C('0174bf4b7e006e4b788a',olympe.sc.logic.qk.nv);olympe.sc.logic.actions={};olympe.sc.logic.qk.lu=class extends olympe.sc.logic.Function{run(a){Tm(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.H.warn('No list to iter upon'),this.H.info(a.V())):f<e?(b(g.Ze(f)),f++,c(Date.now())):(Im(h.C),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.bg();f=0;Hm(h.C);k();break;case 2:k();break;default:this.H.error('Unhandled input')}},this.tag))}};
1075
- olympe.sc.logic.oa.C('0171889b060b6cd54300',olympe.sc.logic.qk.lu);olympe.sc.logic.Qb={};olympe.sc.logic.Qb.pl=class extends olympe.sc.logic.sd{J(){return this.C('016ac638085357047a2d')}};olympe.sc.logic.Qb.pl.P=gn('0169b6876a03f14ae61b',olympe.sc.logic.Qb.pl);olympe.sc.logic.Qb.pl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Dl=class extends olympe.sc.logic.sd{J(){return this.C('016ac63808535703691c')}};olympe.sc.logic.Qb.Dl.P=gn('0169b6876a03f139d50a',olympe.sc.logic.Qb.Dl);olympe.sc.logic.Qb.Dl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Sl=class extends olympe.sc.logic.sd{J(){return this.C('016ac63809a9a8e6db96')}O(){return this.F('016ac6380ab003363b3e')}};gn('01646ad602f933b8caaf',olympe.sc.logic.Qb.Sl);olympe.sc.logic.Qb.Sl.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Sl.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Kj=class extends olympe.sc.logic.sd{J(){return this.C('016ac6380bd98f1d91a0')}T(){return this.F('016ac63c589ae38ca3ae')}O(){return this.F('016ac63c5a377fceabaa')}};gn('0168ec42fc01747a98b6',olympe.sc.logic.Qb.Kj);olympe.sc.logic.Qb.Kj.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Qb.Kj.prototype.T.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Kj.prototype.O.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Qb.Cg=class extends olympe.sc.logic.sd{Fl(){return this.C('017a7b07b09e3b22c8b4')}yp(){return this.C('017a7b07ba05807a74b0')}Gl(){return this.F('017a7b0818c12388d731')}Hl(){return this.F('017a7b085146d5e69aec')}Vt(){return olympe.D.fa.F}};olympe.sc.logic.Qb.Cg.J='017a7b07b09e3b22c8b4';olympe.sc.logic.Qb.Cg.Ub='017a7b07ba05807a74b0';olympe.sc.logic.Qb.Cg.Fa='017a7b0818c12388d731';olympe.sc.logic.Qb.Cg.C='017a7b085146d5e69aec';
1076
- olympe.sc.logic.Qb.Cg.P=gn('017a7b07a948e30508fa',olympe.sc.logic.Qb.Cg,olympe.sc.logic.xh);m=olympe.sc.logic.Qb.Cg.prototype;m.Fl.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.yp.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Gl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Hl.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Vt.L=olympe.D.K.O;olympe.sc.logic.Qb.Wq=class extends olympe.sc.logic.sd{J(){return this.C('016ac63c5b3ed0562740')}};gn('016a9766c230916ea5ec',olympe.sc.logic.Qb.Wq);olympe.sc.logic.Qb.Wq.prototype.J.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.Cn=class extends olympe.sc.vg{};olympe.sc.query.Cn.P=olympe.dc.oa.C('01631aacd8276ea98491',olympe.sc.query.Cn);olympe.sc.query.eq=class extends olympe.dm.Enum{};olympe.sc.query.eq.P=olympe.dc.oa.C('01631aacd8276ea98495',olympe.sc.query.eq);olympe.sc.query.pq=class extends olympe.dm.Enum{};olympe.sc.query.pq.P=olympe.dc.oa.C('01631aacd8276ea98494',olympe.sc.query.pq);olympe.sc.query.sq=class extends olympe.sc.vg{};olympe.sc.query.sq.P=olympe.dc.oa.C('01631aacd8276ea98492',olympe.sc.query.sq);olympe.sc.query.$c=class extends olympe.dc.CloudObject{};olympe.sc.query.$c.P=olympe.dc.oa.C('01631aacd8276ea98493',olympe.sc.query.$c);olympe.sc.ho=class extends olympe.dc.CloudObject{};olympe.sc.ho.P=olympe.dc.oa.C('018312ceeb3e93618a85',olympe.sc.ho);olympe.sc.Mb={};olympe.sc.Mb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.wb(olympe.sc.Mb.Comment.T)}F(){return this.wb(olympe.sc.Mb.Comment.G)}C(){return new olympe.D.Tb(this.cd(olympe.sc.Mb.Comment.J),this.cd(olympe.sc.Mb.Comment.F))}static Vc(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ha(olympe.dc.CloudObject.containsRel,c,b);a.Ha(olympe.sc.Mb.Comment.C,b,c);c=a.create(olympe.sc.ui.zd.oq);Z(c,olympe.sc.ui.zd.oq.XD,d.vp());Z(c,olympe.sc.ui.zd.oq.YD,d.wp());a.Ha(olympe.dm.BrickMetadata.ka,
1077
- b,c);a.Ha(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Mb.Comment.Z=100;olympe.sc.Mb.Comment.O=66;olympe.sc.Mb.Comment.P=olympe.dc.oa.C('0184bd886ee1c7adfe09',olympe.sc.Mb.Comment);olympe.sc.Mb.Comment.T=olympe.sc.Mb.Comment.P.la('0184c80e29ed08a16c5e');olympe.sc.Mb.Comment.G=olympe.sc.Mb.Comment.P.la('0184bd889f33359cfe75');olympe.sc.Mb.Comment.J=olympe.sc.Mb.Comment.P.la('0184c3f9406e25a41512');olympe.sc.Mb.Comment.F=olympe.sc.Mb.Comment.P.la('0184c3f942e4cc136ce8');
1078
- olympe.sc.Mb.Comment.C=olympe.sc.Mb.Comment.P.ra('0184be3f135a83fd6cc3');olympe.sc.Mb.Comment.prototype.getType.L=olympe.D.K.F;olympe.sc.Mb.Comment.prototype.F.L=olympe.D.K.F;olympe.sc.Mb.Comment.prototype.C.L=olympe.D.K.T;olympe.sc.Mb.el=class extends olympe.dm.Enum{};olympe.sc.Mb.el.C={dz:'Comment',wC:'Todo'};olympe.sc.Mb.el.P=olympe.dc.oa.C('0184cc42e06205501bc7',olympe.sc.Mb.el);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.P=olympe.dc.oa.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13a');
1079
- olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.ra('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.ra('017ffdd8f0b1e31fe13f');olympe.sc.workflow.pf=class extends olympe.sc.logic.sd{Wt(){return this.C('017ffe02381f9fac5060')}Zt(){return this.C('017ffe02381f9fac5061')}$t(){return this.C('017ffe02381f9fac5062')}Jw(){return this.C('017ffe02381f9fac5065')}Xt(){return this.F('017ffe02381f9fac5063')}Yt(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.pf.P=gn('017ffde21f5fe0f704ce',olympe.sc.workflow.pf);olympe.sc.workflow.pf.C='017ffe02381f9fac5060';olympe.sc.workflow.pf.Td='017ffe02381f9fac5061';
1080
- olympe.sc.workflow.pf.De='017ffe02381f9fac5062';olympe.sc.workflow.pf.Fa='017ffe02381f9fac5065';olympe.sc.workflow.pf.J='017ffe02381f9fac5063';olympe.sc.workflow.pf.Ub='017ffe02381f9fac5064';m=olympe.sc.workflow.pf.prototype;m.Wt.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Zt.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.$t.L=new olympe.D.K(()=>olympe.sc.logic.ub,[]);m.Jw.L=new olympe.D.K(()=>Map,[]);m.Xt.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);m.Yt.L=new olympe.D.K(()=>olympe.sc.logic.Bb,[]);olympe.sc.workflow.Ue=class extends olympe.dm.BrickMetadata{Oc(){return this.qc(olympe.sc.workflow.Workflow.statesRel.cc(),olympe.sc.workflow.Workflow).na().concat(['.',this.na()])}};olympe.sc.workflow.Ue.P=olympe.dc.oa.C('017ffdc2dda51d46b430',olympe.sc.workflow.Ue);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Ur()}C(){return this.qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ue)}G(){return this.qc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ue)}Oc(){const a=this.qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ue);return a.qc(olympe.sc.workflow.Workflow.statesRel.cc(),olympe.sc.workflow.Workflow).na().concat(['.',a.na(),'->',this.na()])}};
1081
- olympe.sc.workflow.Transition.P=olympe.dc.oa.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.P.la('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.P.ra('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.P.ra('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.L=new olympe.D.K(()=>olympe.dc.CloudObject,[]);
1082
- olympe.sc.workflow.Transition.prototype.C.L=new olympe.D.K(()=>olympe.sc.workflow.Ue,[]);olympe.sc.workflow.Transition.prototype.G.L=new olympe.D.K(()=>olympe.sc.workflow.Ue,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{pe(){return olympe.sc.zd.Be.fh}G(){return this.Qg(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.qc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Dc)}F(){return this.qc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ue)}};olympe.sc.workflow.Workflow.P=olympe.dc.oa.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.P.la('017ffdc010e5bcc9c972');
1083
- olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.P.ra('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.P.ra('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.P.ra('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.L=olympe.D.K.O;olympe.sc.workflow.Workflow.prototype.C.L=new olympe.D.K(()=>olympe.sc.Dc,[]);
1084
- olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.K(()=>olympe.sc.workflow.Ue,[]);olympe.sc.qa={};olympe.sc.qa.Rc=class extends olympe.sc.Ua{pe(){return olympe.sc.zd.Be.Zu}};olympe.sc.qa.Rc.P=olympe.dc.oa.C('01120300000000adef00',olympe.sc.qa.Rc);olympe.sc.qa.Rc.C=olympe.sc.qa.Rc.P.ra('0171bc1f15da96dfdb89');olympe.sc.qa.Rc.Fa=olympe.sc.qa.Rc.P.ra('0171bc1f15da96dfdb90');T(olympe.dm.Jc.P,olympe.sc.qa.Rc.C);olympe.sc.qa.Zh=class extends olympe.sc.Runnable{G(){return[this.ec()]}ua(){return olympe.dc.hd.from(this.ec()).fb(olympe.sc.qa.Rc.C).nd()}};olympe.sc.qa.Zh.P=Af(olympe.dc.oa.C('0113030000000aca1100',olympe.sc.qa.Zh));olympe.sc.qa.Zh.prototype.ua.L=new olympe.D.K(()=>olympe.dm.jb,[]);olympe.sc.qa.mb=class extends olympe.dc.CloudObject{bu(){return this.Qg(olympe.sc.qa.mb.Gh)}Xx(){return this.Qg(olympe.sc.qa.mb.ka)}Hc(){return this.cd(olympe.sc.qa.mb.C)}Pw(){return this.wb(olympe.sc.qa.mb.J)}mx(){return this.wb(olympe.sc.qa.mb.ea)}lx(){return this.wb(olympe.sc.qa.mb.Z)}Fe(){return this.wb(olympe.sc.qa.mb.aa)}Zw(){return this.wb(olympe.sc.qa.mb.O)}yw(){return this.wb(olympe.sc.qa.mb.F)}kx(){return this.wb(olympe.sc.qa.mb.T)}au(){return this.wb(olympe.sc.qa.mb.G)}};
1085
- olympe.sc.qa.mb.P=olympe.dc.oa.C('011203300000000adef5',olympe.sc.qa.mb);olympe.sc.qa.mb.Gh=olympe.sc.qa.mb.P.la('011203300000000adef6');olympe.sc.qa.mb.ka=olympe.sc.qa.mb.P.la('011203300000000adef7');olympe.sc.qa.mb.C=olympe.sc.qa.mb.P.la('011203300000000adef8');olympe.sc.qa.mb.J=olympe.sc.qa.mb.P.la('011203300000000adef9');olympe.sc.qa.mb.ea=olympe.sc.qa.mb.P.la('011203300000000adefa');olympe.sc.qa.mb.Z=olympe.sc.qa.mb.P.la('011203300000000adefb');olympe.sc.qa.mb.F=olympe.sc.qa.mb.P.la('011203300000000adefc');
1086
- olympe.sc.qa.mb.aa=olympe.sc.qa.mb.P.la('011203300000000adefd');olympe.sc.qa.mb.O=olympe.sc.qa.mb.P.la('011203300000000adefe');olympe.sc.qa.mb.T=olympe.sc.qa.mb.P.la('011203300000000adeff');olympe.sc.qa.mb.G=olympe.sc.qa.mb.P.la('011203300000000adee0');olympe.sc.qa.mb.Lb={INIT:0,bz:1,$j:2,Zj:3,gm:4,JB:5,zb:9};m=olympe.sc.qa.mb.prototype;m.bu.L=olympe.D.K.O;m.Xx.L=olympe.D.K.O;m.Hc.L=olympe.D.K.G;m.Pw.L=olympe.D.K.F;m.mx.L=olympe.D.K.F;m.lx.L=olympe.D.K.F;m.Fe.L=olympe.D.K.F;m.Zw.L=olympe.D.K.F;
1087
- m.yw.L=olympe.D.K.F;m.kx.L=olympe.D.K.F;m.au.L=olympe.D.K.F;olympe.sc.qa.zl=class extends olympe.sc.qa.Zh{F(a){a.set(olympe.sc.xa.C.sn,!0);super.F(a)}ka(){return!0}};olympe.sc.qa.zl.P=olympe.dc.oa.C('0113032000000aca1102',olympe.sc.qa.zl,olympe.sc.R.Ca);olympe.sc.qa.Te=class extends olympe.sc.qa.Rc{C(){return(new olympe.dc.Ej(this.X(),olympe.sc.qa.mb)).fb(olympe.sc.qa.Te.J).ri().Gc()}};olympe.sc.qa.Te.P=olympe.dc.oa.C('011203300000000adef3',olympe.sc.qa.Te);olympe.sc.qa.Te.J=olympe.sc.qa.Te.P.ra('011203300000000adef4');T(olympe.sc.qa.mb.P,olympe.sc.qa.Te.J);
1088
- olympe.sc.qa.Te.P.C=(a,b,c)=>{b=dl(a,b||'New Service Application model',olympe.sc.qa.Te,olympe.sc.qa.zl);a.Ha(olympe.sc.qa.Rc.C,b,c);c=a.create(olympe.sc.qa.mb).X();a.Ha(olympe.sc.qa.Te.J,b,c);return b.X()};olympe.sc.qa.Te.prototype.C.L=new olympe.D.K(()=>olympe.sc.qa.mb,[]);olympe.sc.Hg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Hg.P=olympe.dc.oa.C('011203300000000adf00',olympe.sc.Hg);olympe.sc.Hg.F=olympe.sc.Hg.P.la('011203300000000adf01');olympe.sc.Hg.C=olympe.sc.Hg.P.la('011203300000000adf02');olympe.sc.Hg.G='011203300000000adf0f';olympe.sc.gg={};olympe.sc.gg.Nx=a=>{var b=a.C;const c=olympe.dc.ia();var d=null;for(const e of b.bd())if((b=e.Wb())&&e.F()&&e.sb()===olympe.dc.Qa.SERVER&&Uk(a,e.tag())&&c.Rb(b,olympe.sc.Dc)){let f,g;null==d&&(d=null,null!==an?d=an:'string'===typeof $m&&(d=olympe.dc.hd.from($m).fb(olympe.sc.qa.Rc.C).fb(olympe.sc.Xc.C.cc()).nd()),d=null==(f=d)?void 0:f.X());d=null!=(g=d)?g:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ga(b)}`);a.Ha(olympe.sc.Xc.F.X(),d,e.tag())}};
1089
- olympe.sc.gg.Zx=a=>{const b=a.C,c=olympe.dc.ia();for(const d of b.bd()){const e=d.Wb();e&&!d.yd()&&c.Rb(e,olympe.sc.Dc)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.Fc){const l=b.Lc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.ga(olympe.sc.Jd)){h=l.Jb(olympe.sc.Jd.C);if(!h)throw Error('No object reference found for new ObjectRef');
1090
- var k;let p;f=null!=(p=null==(k=b.Lc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Ef(f,olympe.dm.ye)){k=nm(f);let p;n=null!=(p=l.Ra(k.X()))?p:c.Ra(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.Qc(d.tag(),new Map([[g,n]]));Yk(a,l.tag(),olympe.dc.Ob.Cc)}})}};
1091
- olympe.sc.gg.$v=a=>{const b=a.C,c=olympe.dc.ia(),d=new Set;for(var e of b.C.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.Tc()&&(d.has(g)||c.Rb(g,olympe.sc.Dc))){d.add(g);const h=Array.from(e.ka()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.nc.Zc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Lc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Rb(p,olympe.sc.Dc))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Lc(h))?void 0:k.Wb())?l:c.model(h))?n:
1092
- '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.gg.qy=a=>{var b=a.C;const c=olympe.dc.ia();for(const d of b.bd()){b=d.tag();const e=d.Wb();if(e&&c.Rb(e,olympe.sc.lg)&&Uk(a,b))throw Error(`Config DataType instances cannot be persisted or updated if already persisted: ${c.name(e)} (${e})`);}};
1093
- olympe.W.run([olympe.dc.transaction.R.Ea],a=>{jl(jl(jl(a,olympe.sc.gg.$v,'businessDataRelations'),olympe.sc.gg.Nx),olympe.sc.gg.Zx)});olympe.sc.dh=class extends olympe.dm.BrickMetadata{pe(){return olympe.sc.zd.Be.fh}};olympe.sc.dh.P=olympe.dc.oa.C('01645fe6873aeea59e64',olympe.sc.dh);olympe.sc.dh.C=olympe.sc.dh.P.ra('017ed8ac775f48d4d589');olympe.sc.dh.F=olympe.sc.dh.P.ra('017ed8ac775f48d4d590');olympe.sc.co=class extends olympe.dm.Kb{pe(){return olympe.sc.zd.Be.fh}};olympe.sc.co.P=olympe.dc.oa.C('0163a68ce44f3d1fa95d',olympe.sc.co);olympe.sc.lg=class extends olympe.dm.BrickMetadata{};olympe.sc.lg.P=olympe.dc.oa.C('016324fde11a836f77d3',olympe.sc.lg);olympe.sc.lg.C=olympe.sc.Dc.P.ra('016324fde11a836088d3');olympe.sc.lg.P.C=(a,b)=>dl(a,null!=b?b:'New config type',olympe.sc.lg).X();olympe.sc.lz=class{};olympe.sc.tj=class extends olympe.dm.BrickMetadata{pe(){return olympe.sc.zd.Be.fh}};olympe.sc.tj.P=olympe.dc.oa.C('017dc8d6c8fd8c8bd2ff',olympe.sc.tj);olympe.sc.tj.P.C=(a,b)=>dl(a,null!=b?b:'New data connector',olympe.sc.tj,olympe.dm.DataSource).X();olympe.sc.se=class extends olympe.sc.Runnable{Fa(){return this.bb(olympe.sc.se.G,olympe.sc.Runnable)}ua(){return this.bb(olympe.sc.se.F,olympe.dm.Property)}};olympe.sc.se.P=Af(olympe.dc.oa.C('016c2d996d9ca27fa9d8',olympe.sc.se));olympe.sc.se.G=olympe.sc.se.P.ra('016c3cb7742ec9309e0b');olympe.sc.se.F=olympe.sc.se.P.ra('016c42d3454636f90533');olympe.sc.se.prototype.Fa.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.se.prototype.ua.L=new olympe.D.K(()=>olympe.dc.za,[]);olympe.sc.Go=class extends olympe.dm.Kb{pe(){return olympe.sc.zd.Be.fh}};olympe.sc.Go.P=olympe.dc.oa.C('017a7a9ff057958e5678',olympe.sc.Go);olympe.sc.fi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ia(b)&&f.bd(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.fi.create=olympe.sc.fi.create;olympe.sc.fi.P=olympe.dc.oa.C('016cdd861b32d56c8208',olympe.sc.fi);olympe.sc.Ip=class extends olympe.dm.Kb{pe(){return olympe.sc.zd.Be.yv}};olympe.sc.Ip.P=olympe.dc.oa.C('01644b6d4543b344b857',olympe.sc.Ip);olympe.sc.Jp=class extends olympe.dc.CloudObject{};olympe.sc.Jp.P=olympe.dc.oa.C('0162f672366be5ca7a86',olympe.sc.Jp);const ln={Fo:30};olympe.sc.fc=class extends olympe.dc.sources.fc{F(a){return a instanceof olympe.sc.logic.Error?Q(ln.Fo,{c:a.code,m:a.message,s:a.me()}):super.F(a)}C(a){return(null==a?void 0:a.t)===ln.Fo?(a=a.v,sm(a.m,a.c,a.s)):super.C(a)}O(a){super.O(a);if(this.db.model(a)===olympe.sc.Jd.P.X()){const b=olympe.sc.Jd.C;this.G.get(a).r.push({r:b.X(),d:this.db.Jb(a,b)})}return a}};olympe.sc.Xq=class extends olympe.sc.se{};olympe.sc.Xq.P=olympe.dc.oa.C('016d3f37610ae4fc3962',olympe.sc.Xq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.oa.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=bl(a);a.O.push(olympe.sc.gg.qy);this.C=a;this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}V(){return this.C.V()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Xd().fromModel(a);a=this.C.create(a,d).Uh(c);for(const [e,f]of b)Z(a,e,f);b=a.X();this.F.push(b);return b}update(a,
1094
- b,c){this.C.update(a,b,c);return this}bs(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.Dd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ha(a,b,c){this.C.Ha(a,b,c);return this}jc(a,b,c){this.C.jc(a,b,c);return this}Jm(a,b){this.C.Jm(a,b);return this}persist(a,b=!0){this.C.persist(a,b);return this}py(a,b=!0){olympe.ma.gb('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');return this.persist(a,b)}Uh(a){this.source=
1095
- a;return this}model(a){return this.C.model(a)}merge(a){cl(this.C,a.C);return this}Cm(a){this.C.Cm(a);return this}ob(){return new Promise((a,b)=>{this.C.ob((c,d)=>{c?a(new olympe.sc.Ii(this.F)):b(d)})})}Km(){return new Promise((a,b)=>{this.C.Km((c,d)=>{c?a(new olympe.sc.Ii(this.F)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.Km;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.ob;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Cm;
1096
- 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.Uh;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.py;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Jm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.jc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Ha;
1097
- olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.bs;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.V;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.Ii=class{constructor(a){this.C=a}Gw(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Ii.prototype.getCreatedObjects=olympe.sc.Ii.prototype.Gw;olympe.vc={};olympe.vc.ys=class{run(){}};function mn(a,b='default'){return a.C===b}
1098
- olympe.vc.Sa=class{constructor(a,b){this.C=a;this.H=b;this.F=null;this.G='';this.H.info('HC Manager will execute application registered as:',this.C)}ej(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.H.log('Application',c,'designated to be launched'):this.H.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.H.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.H.info('Running application:',this.G),
1099
- this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.vc.ej=function(a,b,c='default'){const d=a.gb();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.vc.U.Je+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.vd(olympe.vc.R.Ea).config(c,[b],(e,f)=>f.ej(e,c,b),e=>mn(e,c),'olympe.hc.registerApp')};olympe.vc.R={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.vc.U={Je:'hc.app',Xo:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.vc.U.Je,'default');F(a,olympe.vc.U.Xo,!1);E(a,olympe.vc.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('hc'));E(a,olympe.Db.R.Fg,[new olympe.W.ja(olympe.vc.U.Je)],b=>b);E(a,olympe.auth.R.Nk,[olympe.Db.R.Fg,new olympe.W.ja(olympe.vc.U.Xo)],(b,c)=>new olympe.auth.Bn(c?'':b));D(a,olympe.vc.R.Ea,olympe.vc.Sa,new olympe.W.ja(olympe.vc.U.Je),olympe.vc.R.Ca)},'olympe.hc');
1100
- olympe.W.run([olympe.vc.R.Ea],a=>a.run(),'olympe.hc');olympe.sc.Gb={};function nn(a,b){if(a.ea)a.H.debug('Sending getContext request'),Th(a.ka).then(()=>{a.H.debug('synchronisation request successful');$m=a.C;b()}).catch(c=>{a.H.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=qm(a.F);!c&&nk();a.H.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Uq(d);e.add((f,g)=>{const h=olympe.dc.ia(),k=new olympe.D.Zb('Primordial Subscription Context',d);Jh(k,a.C,l=>{l=h.Sh(l)?l:h.model(l);return null!==
1101
- l&&h.Rb(l,olympe.sc.lg)},{Od:on(c),kn:!0}).subscribe(rxjs.Subscriber.create(d.G(()=>{h.Rb(a.C,olympe.sc.qa.Rc)?(a.ua.Z(a.C,c),f()):dd(a.O)?g(`The specified application tag (${a.C}) is not an application or does not exist`):(k.destroy(),a.O.connect().catch(l=>{g(`Failed to load the app while offline, you might want to try again when online: ${l}`)}))}),l=>g(String(l))))});e.add(f=>{olympe.D.Nc([a.aa.oe()],g=>{const h=on(c,!1);olympe.dc.pa.Ee(g,olympe.dm.User).observe(olympe.D.$a(),{Od:h,lk:'__code-as-data__'}).subscribe(()=>
1102
- d.run(f))})});e.add((f,g)=>{if(pn(a.C)){const h=olympe.sc.Xc.Lb.Bp,k=olympe.sc.Xc.Lb.ti;bn(a.C,a.kb,l=>{l===h||l===k?d.run(f):d.run(()=>g('Error while loading the business container'))})}else f()});Rc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
1103
- function qn(a){a.H.info('Starting application '+a.C);const b=olympe.D.ic(olympe.D.fa).update(olympe.D.fa.C),c=olympe.dc.ia();if(0<a.C.length){const d=af(c,a.C,a.F.F().G((g,h)=>{if(g)if(g=Sm(h),g instanceof olympe.sc.qa.Zh){a.H.debug('application retrieved: running');h=om(a.F,g);const k=new olympe.sc.Ya.Nu(a.J);$a(a.J,()=>Am(a.F.C,k));ab(a.J,()=>{var l=k.V();return Cm(a.F.C,l)});a.Fa&&a.J.start();g.run(h);'string'===typeof a.ab&&(new olympe.sc.Qd).ea(g.X(),h,a.H);h.ps(olympe.sc.xa.C.sn).then(()=>{let l;
1104
- null==(l=e)||l.cancel();b.update(olympe.D.fa.F);rn(a)})}else a.H.error('application retrieved: not an Application with a run() method');else sn(a)}));olympe.D.$a().onDestroy(()=>{Ze(c,a.C,d)});const e=jc(()=>{a.H.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4);let f;null==(f=a.vb)||f.start()}tn(a);un(a,b)}
1105
- function rn(a){a.H.info(`Application ${olympe.dc.ia().name(a.C)} (${a.C}) started`);a=olympe.dc.sources.Vd();a.Ib=!0;a.Z+=0;a.ad.next(0<a.Z);0===a.Z&&a.aa&&a.Ib&&(a.H.debug(`Cache: set code-as-data version in local storage: ${a.version}`),a.ab.set('__code-as-data-version__',a.version),a.vb||(a.aa=!1))}function on(a,b=!0){return a?olympe.dc.pa.$c.Yl:b?olympe.dc.pa.$c.Lf:olympe.dc.pa.$c.Xl}function sn(a){a.H.info('Stop the application');rn(a);a.F.F().ka();a.G.G(a.T);a.G.O(a.Z)}
1106
- function tn(a){a.Z=a.G.F(()=>v(function*(){return sn(a)}),'Stop application')}function un(a,b){a.T=a.G.C(()=>olympe.D.Ma(b)===olympe.D.fa.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
1107
- olympe.sc.Gb.fm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.aa=b;this.O=c;this.ka=d;this.G=e;this.Z=this.T='';this.F=f;this.ua=g;this.J=h;this.vb=l;this.C=k.get('appTag');this.ea=k.get('getContextMode');let n;this.ab=null!=(n=k.get('debuggerName'))?n:null;this.Fa=k.get('autostartProfiler');this.kb=k.get('loadBusinessContainer')}run(){this.H.debug('runtime starting for app #'+this.C);let a=!1;const b=olympe.N.rc.C.yi,c=olympe.N.rc.C.de,d=olympe.N.rc.C.$d;olympe.D.Nc([this.O.getState()],e=>
1108
- {switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');a||(a=!0,nn(this,()=>qn(this)));break;case d:this.H.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Gb.fm.C='app_instance';olympe.sc.Gb.fm.ya=[olympe.vc.ys];olympe.sc.Gb.Xu=class{constructor(a,b,c,d){this.H=a;this.G=b;this.F=c;this.J=d.get('httpManifestPath');this.C=d.get('manifestCommon');if(!this.C)this.C={};else if('string'===typeof this.C)try{this.C=JSON.parse(this.C)}catch(e){this.H.warn('Invalid manifest common config'),this.C={}}}start(){const a=b=>{const c=(new URL(b.C())).searchParams.get('origin');if(c)return c;b=b.Wi();this.H.debug('Request headers',JSON.stringify(b,null,2));return b.origin?b.origin:b.vy?(new URL(b.vy)).origin:b[olympe.net.Ba.Headers.Oo]&&
1109
- b[olympe.net.Ba.Headers.Po]?b[olympe.net.Ba.Headers.Po]+'://'+b[olympe.net.Ba.Headers.Oo]:null};this.G.J('manifest',`${this.J}/:${'appTag'}`,[olympe.net.Ba.Sd.GET],(b,c)=>{const d=this;return v(function*(){var e=c.get('appTag');d.H.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.ae('Invalid appTag',olympe.net.Ba.$b.Rk);try{var f=yield olympe.dc.pa.Ee(e,olympe.sc.qa.Rc).ob(d.F)}catch(h){return new olympe.net.ae(`Something went wrong: ${'string'===typeof h?
1110
- h:h.message}`,olympe.net.Ba.$b.Rk)}if(0===f.size())return new olympe.net.ae('App not found',olympe.net.Ba.$b.Ml);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'===
1111
- typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.ae(JSON.stringify(e),olympe.net.Ba.$b.rh,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function pn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.pa.from(a).fb(olympe.sc.qa.Rc.C).fb(olympe.dm.rd.G.cc()).fb(olympe.dm.rd.C).nd();a=olympe.dc.pa.from(a).fb(olympe.sc.qa.Rc.C).fb(olympe.dm.jb.F).nd();return c.concat(a).has(b)}
1112
- olympe.sc.Gb.dk=class extends olympe.dc.sources.dk{T(a){return this.db.Rb(a,olympe.sc.Dc)}Z(a,b){if(!this.J){super.init();var c=olympe.dc.hd.from(a).fb(olympe.sc.qa.Rc.C).nd();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.pa.$c.Yl:olympe.dc.pa.$c.Lf;fk(this,c,b);c=new olympe.D.Zb('deployed data sources');olympe.dc.pa.from(a).fb(olympe.sc.qa.Rc.Fa).observe(c,{Od:b}).subscribe(d=>{const e=
1113
- new olympe.dc.Wa;jf(d).forEach(f=>{e.Ha(olympe.dm.DataSource.dj,this.C,f)});hf(d).forEach(f=>{e.jc(olympe.dm.DataSource.dj,this.C,f)});e.ob()})}}};olympe.sc.Gb.R={Uf:'sc.runtime.Main',Se:'sc.runtime.SourceSolver',Cq:'sc.runtime.appConfig',Eq:'sc.runtime.runtimeHTTPServiceConfig',Dq:'sc.runtime.RuntimeHTTPService',Wp:'sc.runtime.OfflineAppConfig'};olympe.sc.Gb.U={gp:'app.httpManifestPath',Gp:'app.manifest.common',Cp:'sc.loadBusinessContainer'};
1114
- olympe.W.config(function(a){F(a,olympe.sc.Gb.U.gp,'/runtime/manifest');F(a,olympe.sc.Gb.U.Gp,null);F(a,olympe.sc.Gb.U.Cp,!0);E(a,olympe.Db.R.Fg,[new olympe.W.ja(olympe.vc.U.Je),new olympe.W.ja(olympe.sc.U.Je)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Gb.R.Wp,[new olympe.W.ja(olympe.sc.U.Je),new olympe.W.ja(olympe.net.U.xi),new olympe.W.ja(olympe.net.U.Ol)],(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`))?
1115
- g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});La(a,olympe.net.R.Pl,olympe.sc.Gb.R.Wp);D(a,olympe.sc.Gb.R.Se,olympe.sc.Gb.dk,olympe.dc.R.gh,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.U.ll));La(a,olympe.dc.sources.R.Se,olympe.sc.Gb.R.Se);E(a,olympe.sc.Gb.R.Cq,[new olympe.W.ja(olympe.sc.U.Je),new olympe.W.ja(olympe.dc.U.zh),new olympe.W.ja(olympe.sc.U.qo),new olympe.W.ja(olympe.sc.U.un),new olympe.W.ja(olympe.sc.Gb.U.Cp)],(b,c,d,e,f)=>new Map([['appTag',
1116
- b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['loadBusinessContainer',f]]));D(a,olympe.sc.Gb.R.Uf,olympe.sc.Gb.fm,olympe.sc.R.Ca,olympe.auth.R.Ea,olympe.N.R.ff,olympe.dc.query.R.Qj,olympe.host.R.Qe,olympe.sc.R.Uj,olympe.sc.Gb.R.Se,olympe.Y.R.Sf,olympe.sc.Gb.R.Cq,olympe.sc.Gb.R.Dq);E(a,olympe.sc.Gb.R.Eq,[new olympe.W.ja(olympe.sc.Gb.U.gp),new olympe.W.ja(olympe.sc.Gb.U.Gp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Gb.R.Dq,olympe.sc.Gb.Xu,olympe.sc.R.Ca,
1117
- olympe.net.R.Ki,olympe.sc.R.Uj,olympe.sc.Gb.R.Eq);olympe.vc.ej(a,olympe.sc.Gb.R.Uf,'sc.runtime');olympe.vc.ej(a,olympe.sc.Gb.R.Uf,'sc.headless');olympe.vc.ej(a,olympe.sc.Gb.R.Uf)},'olympe.sc.runtime');olympe.public={};olympe.public.La=class a{static ww(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 Je(olympe.public.La.get())}static Ck(b){return a.F(olympe.public.La.get().Ck(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static Iw(){return olympe.D.Ma(olympe.public.La.get().oe())}static ky(b){return a.F(olympe.public.La.get().oe(),b)}static ne(){var b=olympe.D,c=b.Ma;var d=olympe.public.La.get().C.tb().wd();return c.call(b,
1118
- d)}static eg(){return new Promise((b,c)=>{olympe.public.La.get().eg(d=>d?c(d):b())})}static Uw(){return olympe.D.Ma(olympe.public.La.get().Qh())||void 0}static xx(){const b=gd(olympe.public.La.get());return{user:b.Ac(),userTag:b.oe(),nonce:b.wd(),payload:b.ni(),idpName:b.mf(),protocol:b.tg()}}static Tw(){return Array.from(Ke().keys())}static cf(){olympe.public.La.get().cf()}static Ug(b){return new Promise((c,d)=>{olympe.public.La.get().Ug(b,e=>e?d(e):c())})}static Qx(b,c){return olympe.public.La.C((new Map).set('username',
1119
- b).set('password',c),olympe.auth.Ec.C.SRP)}static Rx(b){const c=Ke();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.La.C((new Map).set('idpName',d),b)}static Px(){return olympe.public.La.C(new Map,olympe.auth.Ec.C.SAML)}static Sx(b,c){return olympe.public.La.C((new Map).set('username',b).set('nonce',
1120
- c),olympe.auth.Ec.C.Ql)}static Ox(){return olympe.public.La.C(new Map,olympe.auth.Ec.C.OAUTH2)}static Th(){return olympe.public.La.get().Th()}static C(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ie(olympe.public.La.get(),d,c,()=>{e()})})}static get(){return olympe.auth.le()}static F(b,c){return b.asObservable('function'===typeof c.F?c.F():c)}};olympe.public.La.logout=olympe.public.La.Th;olympe.public.La.loginOpenID=olympe.public.La.Ox;
1121
- olympe.public.La.loginToken=olympe.public.La.Sx;olympe.public.La.loginSAML=olympe.public.La.Px;olympe.public.La.loginSSO=olympe.public.La.Rx;olympe.public.La.loginSRP=olympe.public.La.Qx;olympe.public.La.getUserFromToken=olympe.public.La.Ug;olympe.public.La.sendKeepAlive=olympe.public.La.cf;olympe.public.La.getIDPNames=olympe.public.La.Tw;olympe.public.La.getUserToken=olympe.public.La.xx;olympe.public.La.getIDPToken=olympe.public.La.Uw;olympe.public.La.refreshToken=olympe.public.La.eg;
1122
- olympe.public.La.getToken=olympe.public.La.ne;olympe.public.La.observeUser=olympe.public.La.ky;olympe.public.La.getCurrentUser=olympe.public.La.Iw;olympe.public.La.isAuthenticated=olympe.public.La.Ck;olympe.public.La.getState=olympe.public.La.getState;olympe.public.La.generateSRPData=olympe.public.La.ww;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.$.hg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ic(olympe.D.fa),e=b.subscribe(f=>d.update(olympe.D.Xb(f)));olympe.D.$a().Z(()=>e.unsubscribe());return d.tb()}}}};
1123
- olympe.public.gf=class{static create(a){return new class extends olympe.dc.tc.hg{G(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ic(olympe.D.ba),e=b.subscribe(f=>d.update(olympe.D.sa(f)));olympe.D.$a().Z(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static ly(a,b){const c=olympe.host.vk(),d=c.C(a,b);return()=>c.G(d)}static my(a,b){const c=olympe.host.vk(),d=c.F(a,b);return()=>c.O(d)}static connect(){return olympe.N.Nm().connect()}static disconnect(){return olympe.N.Nm().disconnect()}static cg(a){a='function'===typeof a.F?a.F():a;return olympe.N.Nm().cg().asObservable(a).pipe(rxjs.operators.map(b=>b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.cg;olympe.public.Process.disconnect=olympe.public.Process.disconnect;
1124
- olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.my;olympe.public.Process.onHealthCheck=olympe.public.Process.ly;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Na.Relation,Direction:olympe.dc.wa,generateTag:olympe.Y.zf,tagToString:olympe.dc.ga,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Br,defineInverseRelation:olympe.dc.gw,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.oa.C,FunctionBrick:olympe.sc.logic.Function,
1125
- Context:olympe.sc.xa,Entry:olympe.dc.Na.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.Rf,EnumValue:olympe.sc.fi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.td,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ue,WorkflowTransition:olympe.sc.workflow.Transition,
1126
- WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.ai,TransactionResult:olympe.sc.Ii,PredefinedDataSource:olympe.dc.Qa,QueryResult:olympe.dc.Pa,Query:olympe.dc.pa,QuerySingle:olympe.dc.hd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.Nj,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,Cache:{getCacheEntries:()=>olympe.dc.sources.Vd().O,clearCache:a=>uk(olympe.dc.sources.Vd(),a),getProcessingStatus:()=>
1127
- olympe.dc.sources.Vd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Vd().hc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Vd().ea.asObservable(),synchroniseChanges:()=>Ak(),getPendingChanges:()=>Dk(),clearPendingChanges:()=>Hk(),loadPendingChanges:a=>Fk(a)},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.N.cb.C,ServiceRequest:olympe.N.Sc,Service:olympe.N.yb,Auth:olympe.public.La,AuthState:{INIT:olympe.auth.Sa.C.INIT,AUTHENTICATING:olympe.auth.Sa.C.jj,GUEST:olympe.auth.Sa.C.hi,
1128
- AUTHENTICATED:olympe.auth.Sa.C.df,ERROR:olympe.auth.Sa.C.zb},AuthProtocol:olympe.auth.Ec.C,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.lb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,instanceToTag:olympe.dc.ga,
1129
- registerSync:olympe.dc.oa.C,getUniqueTag:olympe.Y.zf,onDestroy:a=>olympe.D.$a().onDestroy(a),offDestroy:a=>olympe.D.$a().Hf(a),FollowRules:olympe.dc.Ob,transformers:{Related:olympe.dc.da.Re,RecursiveRelated:olympe.dc.da.ze,Distinct:olympe.dc.da.di,Filter:olympe.dc.da.jf,Limit:olympe.dc.da.oh,Sort:olympe.dc.da.Gg,Union:olympe.dc.da.uf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.$.Fd,Or:olympe.dc.$.xe,Not:olympe.dc.$.ce,Equals:olympe.dc.$.te,Contains:olympe.dc.$.hf,Greater:olympe.dc.$.Aj,
1130
- Smaller:olympe.dc.$.ck,HasRelated:olympe.dc.$.ji,InstanceOf:olympe.dc.$.mi,Regex:olympe.dc.$.rf},Comparator:olympe.public.gf,comparators:{Number:olympe.dc.tc.Number,String:olympe.dc.tc.String,DateTime:olympe.dc.tc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.mj,StringProperty:olympe.dc.Za.Ei,NumberProperty:olympe.dc.Za.wi,DateTimeProperty:olympe.dc.Za.ci,Constant:olympe.dc.Za.Le,Tag:olympe.dc.Za.Gi}});
1073
+ function ln(a,b,c,d,e,f){const g=n=>v(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.qd(r)}catch(r){const t=Error(`Error while trying to send the response of remote action ${a.Wb().name()} (${a.ec()}): ${r}`);f.Mh(t).catch(u=>{a.H.error(`Cannot reply with an error to a remote action call ${a.Wb().name()} (${a.ec()}): ${u}`)})}finally{b.destroy()}}}),h=b.V(),k=b.on(c,g,h),l=b.on(d,g,h)}
1074
+ olympe.sc.logic.yh=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.Ma(olympe.sc.xa.C.EDITION))&&b||(this.db.Ra(this,olympe.sc.logic.yh.F)?this.ua(a):(Um(this,a),kn(this,a)))}ua(a){const b=this.ec(),c=this.vd(),d=c.zp().X(),e=c.Fl().X(),f=c.Gl().X(),g=c.Hl().X();(new olympe.N.yb(b,a)).listen().subscribe(rxjs.Subscriber.create(h=>{const k=a.Kh('remote call'),l=h.body(),n=jc(()=>{h.Mh(Error(`Timeout reached on remote action ${this.db.name(this)} (${this.tag})`));
1075
+ k.destroy()},this.timeout);ln(this,k,f,g,n,h);super.run(k);for(const [p,q]of l)p!==e&&k.set(p,q);h.Xh().then(p=>{var q=k.get(d);null!==q&&olympe.dc.ga(q)!==p&&(q=this.ec(),this.H.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.ec();this.H.warn(`Remote action ${this.db.name(q)} ${q} Triggered by unrecognized user: ${p}.`);k.set(g,olympe.sc.logic.Error.create('Unrecognized User',
1076
+ 1))})},h=>{const k=this.ec();this.H.error(`Error while listening on remote action ${this.db.name(k)} (${k}): ${h.message}`)}))}};olympe.sc.logic.yh.P=olympe.dc.oa.C('017a7b0c5dcbd8964c5d',olympe.sc.logic.yh,olympe.sc.R.Ca,new olympe.W.ja(olympe.sc.U.yq));olympe.sc.logic.yh.F=olympe.sc.logic.yh.P.la('017a7b0c62a02a89444f');olympe.sc.logic.controllers={};olympe.sc.logic.controllers.Cl=class{constructor(a){this.db=olympe.dc.ia();this.typeRel=a}};olympe.sc.logic.controllers.Cl.C={qz:-1,rA:1};olympe.sc.logic.controllers.iB=class extends olympe.sc.logic.controllers.Cl{constructor(){super(olympe.sc.logic.gd.C)}};olympe.sc.logic.controllers.qB=class extends olympe.sc.logic.controllers.Cl{constructor(){super(olympe.sc.logic.Tb.typeRel)}};olympe.sc.logic.qk={};olympe.sc.logic.qk.ov=class extends olympe.sc.logic.Function{update(a,[b],[c]){const d=olympe.dc.ga(b);d?olympe.dc.pa.Pb(a,d,olympe.dc.Ob.Uf).subscribe(()=>{c(olympe.dc.CloudObject.get(d))}):this.H.warn('Cannot subscribe to an instance with no tag: '+d)}};olympe.sc.logic.oa.C('0174bf4b7e006e4b788a',olympe.sc.logic.qk.ov);olympe.sc.logic.actions={};olympe.sc.logic.qk.mu=class extends olympe.sc.logic.Function{run(a){Um(this,a);const [b,c,d]=this.C(a);let e,f=null,g=null;const h=a.getParent(),k=()=>{null===g||0===e?(this.H.warn('No list to iter upon'),this.H.info(a.V())):f<e?(b(g.Ze(f)),f++,c(Date.now())):(Jm(h.C),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.bg();f=0;Im(h.C);k();break;case 2:k();break;default:this.H.error('Unhandled input')}},this.tag))}};
1077
+ olympe.sc.logic.oa.C('0171889b060b6cd54300',olympe.sc.logic.qk.mu);olympe.sc.logic.Rb={};olympe.sc.logic.Rb.pl=class extends olympe.sc.logic.sd{K(){return this.C('016ac638085357047a2d')}};olympe.sc.logic.Rb.pl.P=hn('0169b6876a03f14ae61b',olympe.sc.logic.Rb.pl);olympe.sc.logic.Rb.pl.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Rb.Dl=class extends olympe.sc.logic.sd{K(){return this.C('016ac63808535703691c')}};olympe.sc.logic.Rb.Dl.P=hn('0169b6876a03f139d50a',olympe.sc.logic.Rb.Dl);olympe.sc.logic.Rb.Dl.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Rb.Sl=class extends olympe.sc.logic.sd{K(){return this.C('016ac63809a9a8e6db96')}O(){return this.F('016ac6380ab003363b3e')}};hn('01646ad602f933b8caaf',olympe.sc.logic.Rb.Sl);olympe.sc.logic.Rb.Sl.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Rb.Sl.prototype.O.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Rb.Kj=class extends olympe.sc.logic.sd{K(){return this.C('016ac6380bd98f1d91a0')}T(){return this.F('016ac63c589ae38ca3ae')}O(){return this.F('016ac63c5a377fceabaa')}};hn('0168ec42fc01747a98b6',olympe.sc.logic.Rb.Kj);olympe.sc.logic.Rb.Kj.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.logic.Rb.Kj.prototype.T.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Rb.Kj.prototype.O.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);olympe.sc.logic.Rb.Cg=class extends olympe.sc.logic.sd{Fl(){return this.C('017a7b07b09e3b22c8b4')}zp(){return this.C('017a7b07ba05807a74b0')}Gl(){return this.F('017a7b0818c12388d731')}Hl(){return this.F('017a7b085146d5e69aec')}Wt(){return olympe.D.fa.F}};olympe.sc.logic.Rb.Cg.K='017a7b07b09e3b22c8b4';olympe.sc.logic.Rb.Cg.Vb='017a7b07ba05807a74b0';olympe.sc.logic.Rb.Cg.Fa='017a7b0818c12388d731';olympe.sc.logic.Rb.Cg.C='017a7b085146d5e69aec';
1078
+ olympe.sc.logic.Rb.Cg.P=hn('017a7b07a948e30508fa',olympe.sc.logic.Rb.Cg,olympe.sc.logic.yh);m=olympe.sc.logic.Rb.Cg.prototype;m.Fl.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);m.zp.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);m.Gl.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);m.Hl.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);m.Wt.L=olympe.D.J.O;olympe.sc.logic.Rb.Xq=class extends olympe.sc.logic.sd{K(){return this.C('016ac63c5b3ed0562740')}};hn('016a9766c230916ea5ec',olympe.sc.logic.Rb.Xq);olympe.sc.logic.Rb.Xq.prototype.K.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);olympe.sc.query={};olympe.sc.query.Cn=class extends olympe.sc.vg{};olympe.sc.query.Cn.P=olympe.dc.oa.C('01631aacd8276ea98491',olympe.sc.query.Cn);olympe.sc.query.fq=class extends olympe.dm.Enum{};olympe.sc.query.fq.P=olympe.dc.oa.C('01631aacd8276ea98495',olympe.sc.query.fq);olympe.sc.query.qq=class extends olympe.dm.Enum{};olympe.sc.query.qq.P=olympe.dc.oa.C('01631aacd8276ea98494',olympe.sc.query.qq);olympe.sc.query.tq=class extends olympe.sc.vg{};olympe.sc.query.tq.P=olympe.dc.oa.C('01631aacd8276ea98492',olympe.sc.query.tq);olympe.sc.query.$c=class extends olympe.dc.CloudObject{};olympe.sc.query.$c.P=olympe.dc.oa.C('01631aacd8276ea98493',olympe.sc.query.$c);olympe.sc.ho=class extends olympe.dc.CloudObject{};olympe.sc.ho.P=olympe.dc.oa.C('018312ceeb3e93618a85',olympe.sc.ho);olympe.sc.Mb={};olympe.sc.Mb.Comment=class extends olympe.dm.BrickMetadata{getType(){return this.wb(olympe.sc.Mb.Comment.T)}F(){return this.wb(olympe.sc.Mb.Comment.G)}C(){return new olympe.D.Ub(this.cd(olympe.sc.Mb.Comment.K),this.cd(olympe.sc.Mb.Comment.F))}static Vc(a,b,c,...d){c=d[0];d=d[1];b=a.create(b);b.X();a.Ha(olympe.dc.CloudObject.containsRel,c,b);a.Ha(olympe.sc.Mb.Comment.C,b,c);c=a.create(olympe.sc.ui.zd.pq);Z(c,olympe.sc.ui.zd.pq.YD,d.wp());Z(c,olympe.sc.ui.zd.pq.ZD,d.xp());a.Ha(olympe.dm.BrickMetadata.ka,
1079
+ b,c);a.Ha(olympe.dc.CloudObject.containsRel,b,c)}};olympe.sc.Mb.Comment.Z=100;olympe.sc.Mb.Comment.O=66;olympe.sc.Mb.Comment.P=olympe.dc.oa.C('0184bd886ee1c7adfe09',olympe.sc.Mb.Comment);olympe.sc.Mb.Comment.T=olympe.sc.Mb.Comment.P.la('0184c80e29ed08a16c5e');olympe.sc.Mb.Comment.G=olympe.sc.Mb.Comment.P.la('0184bd889f33359cfe75');olympe.sc.Mb.Comment.K=olympe.sc.Mb.Comment.P.la('0184c3f9406e25a41512');olympe.sc.Mb.Comment.F=olympe.sc.Mb.Comment.P.la('0184c3f942e4cc136ce8');
1080
+ olympe.sc.Mb.Comment.C=olympe.sc.Mb.Comment.P.ra('0184be3f135a83fd6cc3');olympe.sc.Mb.Comment.prototype.getType.L=olympe.D.J.F;olympe.sc.Mb.Comment.prototype.F.L=olympe.D.J.F;olympe.sc.Mb.Comment.prototype.C.L=olympe.D.J.T;olympe.sc.Mb.el=class extends olympe.dm.Enum{};olympe.sc.Mb.el.C={ez:'Comment',xC:'Todo'};olympe.sc.Mb.el.P=olympe.dc.oa.C('0184cc42e06205501bc7',olympe.sc.Mb.el);olympe.sc.workflow={};olympe.sc.workflow.ObjectState=class extends olympe.dc.CloudObject{};olympe.sc.workflow.ObjectState.P=olympe.dc.oa.C('017ffdd8f0b1e31fe138',olympe.sc.workflow.ObjectState);olympe.sc.workflow.ObjectState.workflowProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13e');olympe.sc.workflow.ObjectState.stateProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe139');olympe.sc.workflow.ObjectState.assigneeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13a');
1081
+ olympe.sc.workflow.ObjectState.dateTimeProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13b');olympe.sc.workflow.ObjectState.serializedObjectProp=olympe.sc.workflow.ObjectState.P.la('017ffdd8f0b1e31fe13d');olympe.sc.workflow.ObjectState.objectRel=olympe.sc.workflow.ObjectState.P.ra('017ffdd8f0b1e31fe13c');olympe.sc.workflow.ObjectState.currentObjectRel=olympe.sc.workflow.ObjectState.P.ra('017ffdd8f0b1e31fe13f');olympe.sc.workflow.qf=class extends olympe.sc.logic.sd{Xt(){return this.C('017ffe02381f9fac5060')}$t(){return this.C('017ffe02381f9fac5061')}au(){return this.C('017ffe02381f9fac5062')}Kw(){return this.C('017ffe02381f9fac5065')}Yt(){return this.F('017ffe02381f9fac5063')}Zt(){return this.F('017ffe02381f9fac5064')}};olympe.sc.workflow.qf.P=hn('017ffde21f5fe0f704ce',olympe.sc.workflow.qf);olympe.sc.workflow.qf.C='017ffe02381f9fac5060';olympe.sc.workflow.qf.Td='017ffe02381f9fac5061';
1082
+ olympe.sc.workflow.qf.De='017ffe02381f9fac5062';olympe.sc.workflow.qf.Fa='017ffe02381f9fac5065';olympe.sc.workflow.qf.K='017ffe02381f9fac5063';olympe.sc.workflow.qf.Vb='017ffe02381f9fac5064';m=olympe.sc.workflow.qf.prototype;m.Xt.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);m.$t.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);m.au.L=new olympe.D.J(()=>olympe.sc.logic.ub,[]);m.Kw.L=new olympe.D.J(()=>Map,[]);m.Yt.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);m.Zt.L=new olympe.D.J(()=>olympe.sc.logic.Bb,[]);olympe.sc.workflow.Ue=class extends olympe.dm.BrickMetadata{Pc(){return this.qc(olympe.sc.workflow.Workflow.statesRel.cc(),olympe.sc.workflow.Workflow).na().concat(['.',this.na()])}};olympe.sc.workflow.Ue.P=olympe.dc.oa.C('017ffdc2dda51d46b430',olympe.sc.workflow.Ue);olympe.sc.workflow.Transition=class extends olympe.dc.CloudObject{F(){return this.Vr()}C(){return this.qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ue)}G(){return this.qc(olympe.sc.workflow.Transition.toStateRel,olympe.sc.workflow.Ue)}Pc(){const a=this.qc(olympe.sc.workflow.Transition.fromStateRel,olympe.sc.workflow.Ue);return a.qc(olympe.sc.workflow.Workflow.statesRel.cc(),olympe.sc.workflow.Workflow).na().concat(['.',a.na(),'->',this.na()])}};
1083
+ olympe.sc.workflow.Transition.P=olympe.dc.oa.C('017ffdc633219f16beea',olympe.sc.workflow.Transition);olympe.sc.workflow.Transition.processRefProp=olympe.sc.workflow.Transition.P.la('017ffdc633219f16beec');olympe.sc.workflow.Transition.fromStateRel=olympe.sc.workflow.Transition.P.ra('017ffdc2dda51d46b431');olympe.sc.workflow.Transition.toStateRel=olympe.sc.workflow.Transition.P.ra('017ffdc633219f16beeb');olympe.sc.workflow.Transition.prototype.F.L=new olympe.D.J(()=>olympe.dc.CloudObject,[]);
1084
+ olympe.sc.workflow.Transition.prototype.C.L=new olympe.D.J(()=>olympe.sc.workflow.Ue,[]);olympe.sc.workflow.Transition.prototype.G.L=new olympe.D.J(()=>olympe.sc.workflow.Ue,[]);olympe.sc.workflow.Workflow=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.zd.Be.fh}G(){return this.Qg(olympe.sc.workflow.Workflow.serializationEnabledProp)}C(){return this.qc(olympe.sc.workflow.Workflow.dataTypeRel,olympe.sc.Ec)}F(){return this.qc(olympe.sc.workflow.Workflow.initialStateRel,olympe.sc.workflow.Ue)}};olympe.sc.workflow.Workflow.P=olympe.dc.oa.C('017ffdc010e5bcc9c971',olympe.sc.workflow.Workflow);olympe.sc.workflow.Workflow.serializationEnabledProp=olympe.sc.workflow.Workflow.P.la('017ffdc010e5bcc9c972');
1085
+ olympe.sc.workflow.Workflow.dataTypeRel=olympe.sc.workflow.Workflow.P.ra('017ffdc010e5bcc9c973');olympe.sc.workflow.Workflow.statesRel=olympe.sc.workflow.Workflow.P.ra('017ffdc010e5bcc9c974');olympe.sc.workflow.Workflow.initialStateRel=olympe.sc.workflow.Workflow.P.ra('017ffdc010e5bcc9c975');olympe.sc.workflow.Workflow.prototype.G.L=olympe.D.J.O;olympe.sc.workflow.Workflow.prototype.C.L=new olympe.D.J(()=>olympe.sc.Ec,[]);
1086
+ olympe.sc.workflow.Workflow.prototype.F.L=new olympe.D.J(()=>olympe.sc.workflow.Ue,[]);olympe.sc.qa={};olympe.sc.qa.Sc=class extends olympe.sc.Ua{oe(){return olympe.sc.zd.Be.$u}};olympe.sc.qa.Sc.P=olympe.dc.oa.C('01120300000000adef00',olympe.sc.qa.Sc);olympe.sc.qa.Sc.C=olympe.sc.qa.Sc.P.ra('0171bc1f15da96dfdb89');olympe.sc.qa.Sc.Fa=olympe.sc.qa.Sc.P.ra('0171bc1f15da96dfdb90');T(olympe.dm.Jc.P,olympe.sc.qa.Sc.C);olympe.sc.qa.$h=class extends olympe.sc.Runnable{G(){return[this.ec()]}ua(){return olympe.dc.hd.from(this.ec()).gb(olympe.sc.qa.Sc.C).nd()}};olympe.sc.qa.$h.P=Af(olympe.dc.oa.C('0113030000000aca1100',olympe.sc.qa.$h));olympe.sc.qa.$h.prototype.ua.L=new olympe.D.J(()=>olympe.dm.jb,[]);olympe.sc.qa.mb=class extends olympe.dc.CloudObject{cu(){return this.Qg(olympe.sc.qa.mb.Hh)}Yx(){return this.Qg(olympe.sc.qa.mb.ka)}Hc(){return this.cd(olympe.sc.qa.mb.C)}Qw(){return this.wb(olympe.sc.qa.mb.K)}nx(){return this.wb(olympe.sc.qa.mb.ea)}mx(){return this.wb(olympe.sc.qa.mb.Z)}Fe(){return this.wb(olympe.sc.qa.mb.aa)}$w(){return this.wb(olympe.sc.qa.mb.O)}zw(){return this.wb(olympe.sc.qa.mb.F)}lx(){return this.wb(olympe.sc.qa.mb.T)}bu(){return this.wb(olympe.sc.qa.mb.G)}};
1087
+ olympe.sc.qa.mb.P=olympe.dc.oa.C('011203300000000adef5',olympe.sc.qa.mb);olympe.sc.qa.mb.Hh=olympe.sc.qa.mb.P.la('011203300000000adef6');olympe.sc.qa.mb.ka=olympe.sc.qa.mb.P.la('011203300000000adef7');olympe.sc.qa.mb.C=olympe.sc.qa.mb.P.la('011203300000000adef8');olympe.sc.qa.mb.K=olympe.sc.qa.mb.P.la('011203300000000adef9');olympe.sc.qa.mb.ea=olympe.sc.qa.mb.P.la('011203300000000adefa');olympe.sc.qa.mb.Z=olympe.sc.qa.mb.P.la('011203300000000adefb');olympe.sc.qa.mb.F=olympe.sc.qa.mb.P.la('011203300000000adefc');
1088
+ olympe.sc.qa.mb.aa=olympe.sc.qa.mb.P.la('011203300000000adefd');olympe.sc.qa.mb.O=olympe.sc.qa.mb.P.la('011203300000000adefe');olympe.sc.qa.mb.T=olympe.sc.qa.mb.P.la('011203300000000adeff');olympe.sc.qa.mb.G=olympe.sc.qa.mb.P.la('011203300000000adee0');olympe.sc.qa.mb.Lb={INIT:0,cz:1,$j:2,Zj:3,gm:4,KB:5,zb:9};m=olympe.sc.qa.mb.prototype;m.cu.L=olympe.D.J.O;m.Yx.L=olympe.D.J.O;m.Hc.L=olympe.D.J.G;m.Qw.L=olympe.D.J.F;m.nx.L=olympe.D.J.F;m.mx.L=olympe.D.J.F;m.Fe.L=olympe.D.J.F;m.$w.L=olympe.D.J.F;
1089
+ m.zw.L=olympe.D.J.F;m.lx.L=olympe.D.J.F;m.bu.L=olympe.D.J.F;olympe.sc.qa.zl=class extends olympe.sc.qa.$h{F(a){a.set(olympe.sc.xa.C.sn,!0);super.F(a)}ka(){return!0}};olympe.sc.qa.zl.P=olympe.dc.oa.C('0113032000000aca1102',olympe.sc.qa.zl,olympe.sc.R.Ca);olympe.sc.qa.Te=class extends olympe.sc.qa.Sc{C(){return(new olympe.dc.Ej(this.X(),olympe.sc.qa.mb)).gb(olympe.sc.qa.Te.K).si().Gc()}};olympe.sc.qa.Te.P=olympe.dc.oa.C('011203300000000adef3',olympe.sc.qa.Te);olympe.sc.qa.Te.K=olympe.sc.qa.Te.P.ra('011203300000000adef4');T(olympe.sc.qa.mb.P,olympe.sc.qa.Te.K);
1090
+ olympe.sc.qa.Te.P.C=(a,b,c)=>{b=el(a,b||'New Service Application model',olympe.sc.qa.Te,olympe.sc.qa.zl);a.Ha(olympe.sc.qa.Sc.C,b,c);c=a.create(olympe.sc.qa.mb).X();a.Ha(olympe.sc.qa.Te.K,b,c);return b.X()};olympe.sc.qa.Te.prototype.C.L=new olympe.D.J(()=>olympe.sc.qa.mb,[]);olympe.sc.Hg=class extends olympe.dc.CloudObject{static get(){return olympe.dc.CloudObject.get('011203300000000adf0f')}};olympe.sc.Hg.P=olympe.dc.oa.C('011203300000000adf00',olympe.sc.Hg);olympe.sc.Hg.F=olympe.sc.Hg.P.la('011203300000000adf01');olympe.sc.Hg.C=olympe.sc.Hg.P.la('011203300000000adf02');olympe.sc.Hg.G='011203300000000adf0f';olympe.sc.gg={};olympe.sc.gg.Ox=a=>{var b=a.C;const c=olympe.dc.ia();var d=null;for(const e of b.bd())if((b=e.Wb())&&e.F()&&e.sb()===olympe.dc.Qa.SERVER&&Vk(a,e.tag())&&c.Sb(b,olympe.sc.Ec)){let f,g;null==d&&(d=null,null!==bn?d=bn:'string'===typeof an&&(d=olympe.dc.hd.from(an).gb(olympe.sc.qa.Sc.C).gb(olympe.sc.Xc.C.cc()).nd()),d=null==(f=d)?void 0:f.X());d=null!=(g=d)?g:null;if(null===d)throw Error(`No business container for new instance of ${olympe.dc.ga(b)}`);a.Ha(olympe.sc.Xc.F.X(),d,e.tag())}};
1091
+ olympe.sc.gg.$x=a=>{const b=a.C,c=olympe.dc.ia();for(const d of b.bd()){const e=d.Wb();e&&!d.yd()&&c.Sb(e,olympe.sc.Ec)&&d.Cb().forEach((f,g)=>{if(f instanceof olympe.dc.vc){const l=b.Mc(f.X());if(null===l)throw Error(`Try to assign an instance as complex property which is not created within the same transaction: ${f.X()}`);var h;f=null!=(h=null==l?void 0:l.Wb())?h:null;h=l.tag();let n;if(f===olympe.dc.ga(olympe.sc.Jd)){h=l.Jb(olympe.sc.Jd.C);if(!h)throw Error('No object reference found for new ObjectRef');
1092
+ var k;let p;f=null!=(p=null==(k=b.Mc(h))?void 0:k.Wb())?p:c.model(h)}if(c.Ff(f,olympe.dm.xe)){k=om(f);let p;n=null!=(p=l.Ra(k.X()))?p:c.Ra(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.Rc(d.tag(),new Map([[g,n]]));Zk(a,l.tag(),olympe.dc.Ob.Dc)}})}};
1093
+ olympe.sc.gg.aw=a=>{const b=a.C,c=olympe.dc.ia(),d=new Set;for(var e of b.C.values()){a=e.tag();let f;const g=null!=(f=e.Wb())?f:c.model(a);if(null!==g&&e.Uc()&&(d.has(g)||c.Sb(g,olympe.sc.Ec))){d.add(g);const h=Array.from(e.ka()).flatMap(([k,,l,n])=>n&&k!==olympe.dc.nc.Zc?[l]:[]).find(k=>{let l,n;const p=null!=(n=null==(l=b.Mc(k))?void 0:l.Wb())?n:c.model(k);return!p||!(d.has(p)||c.Sb(p,olympe.sc.Ec))});if(void 0!==h){let k,l,n;e=null!=(n=null!=(l=null==(k=b.Mc(h))?void 0:k.Wb())?l:c.model(h))?n:
1094
+ '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.gg.sy=a=>{var b=a.C;const c=olympe.dc.ia();for(const d of b.bd()){b=d.tag();const e=d.Wb();if(e&&c.Sb(e,olympe.sc.lg)&&Vk(a,b))throw Error(`Config DataType instances cannot be persisted or updated if already persisted: ${c.name(e)} (${e})`);}};
1095
+ olympe.W.run([olympe.dc.transaction.R.Ea],a=>{kl(kl(kl(a,olympe.sc.gg.aw,'businessDataRelations'),olympe.sc.gg.Ox),olympe.sc.gg.$x)});olympe.sc.dh=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.zd.Be.fh}};olympe.sc.dh.P=olympe.dc.oa.C('01645fe6873aeea59e64',olympe.sc.dh);olympe.sc.dh.C=olympe.sc.dh.P.ra('017ed8ac775f48d4d589');olympe.sc.dh.F=olympe.sc.dh.P.ra('017ed8ac775f48d4d590');olympe.sc.co=class extends olympe.dm.Kb{oe(){return olympe.sc.zd.Be.fh}};olympe.sc.co.P=olympe.dc.oa.C('0163a68ce44f3d1fa95d',olympe.sc.co);olympe.sc.lg=class extends olympe.dm.BrickMetadata{};olympe.sc.lg.P=olympe.dc.oa.C('016324fde11a836f77d3',olympe.sc.lg);olympe.sc.lg.C=olympe.sc.Ec.P.ra('016324fde11a836088d3');olympe.sc.lg.P.C=(a,b)=>el(a,null!=b?b:'New config type',olympe.sc.lg).X();olympe.sc.mz=class{};olympe.sc.tj=class extends olympe.dm.BrickMetadata{oe(){return olympe.sc.zd.Be.fh}};olympe.sc.tj.P=olympe.dc.oa.C('017dc8d6c8fd8c8bd2ff',olympe.sc.tj);olympe.sc.tj.P.C=(a,b)=>el(a,null!=b?b:'New data connector',olympe.sc.tj,olympe.dm.DataSource).X();olympe.sc.re=class extends olympe.sc.Runnable{Fa(){return this.bb(olympe.sc.re.G,olympe.sc.Runnable)}ua(){return this.bb(olympe.sc.re.F,olympe.dm.Property)}};olympe.sc.re.P=Af(olympe.dc.oa.C('016c2d996d9ca27fa9d8',olympe.sc.re));olympe.sc.re.G=olympe.sc.re.P.ra('016c3cb7742ec9309e0b');olympe.sc.re.F=olympe.sc.re.P.ra('016c42d3454636f90533');olympe.sc.re.prototype.Fa.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.sc.re.prototype.ua.L=new olympe.D.J(()=>olympe.dc.za,[]);olympe.sc.Go=class extends olympe.dm.Kb{oe(){return olympe.sc.zd.Be.fh}};olympe.sc.Go.P=olympe.dc.oa.C('017a7a9ff057958e5678',olympe.sc.Go);olympe.sc.gi=class extends olympe.dm.Enum{static create(a,b,c,d,e){const f=olympe.dc.ia();e=void 0!==e?e:f.Ia(b)&&f.bd(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.gi.create=olympe.sc.gi.create;olympe.sc.gi.P=olympe.dc.oa.C('016cdd861b32d56c8208',olympe.sc.gi);olympe.sc.Jp=class extends olympe.dm.Kb{oe(){return olympe.sc.zd.Be.zv}};olympe.sc.Jp.P=olympe.dc.oa.C('01644b6d4543b344b857',olympe.sc.Jp);olympe.sc.Kp=class extends olympe.dc.CloudObject{};olympe.sc.Kp.P=olympe.dc.oa.C('0162f672366be5ca7a86',olympe.sc.Kp);const mn={Fo:30};olympe.sc.fc=class extends olympe.dc.sources.fc{F(a){return a instanceof olympe.sc.logic.Error?Q(mn.Fo,{c:a.code,m:a.message,s:a.le()}):super.F(a)}C(a){return(null==a?void 0:a.t)===mn.Fo?(a=a.v,tm(a.m,a.c,a.s)):super.C(a)}K(a){super.K(a);if(this.db.model(a)===olympe.sc.Jd.P.X()){const b=olympe.sc.Jd.C;this.G.get(a).r.push({r:b.X(),d:this.db.Jb(a,b)})}return a}};olympe.sc.Yq=class extends olympe.sc.re{};olympe.sc.Yq.P=olympe.dc.oa.C('016d3f37610ae4fc3962',olympe.sc.Yq);olympe.sc.Text=class extends olympe.dm.String{};olympe.sc.Text.P=olympe.dc.oa.C('016cfca73e63f9ab5ba4',olympe.sc.Text);olympe.sc.Wa=class{constructor(a=!0){a=cl(a);a.O.push(olympe.sc.gg.sy);this.C=a;this.F=[];this.source=null}static from(a){const b=olympe.sc.xa.C.TRANSACTION;return a.has(b,!0)?a.get(b,!0):new olympe.sc.Wa}static process(a,b){return a.has(olympe.sc.xa.C.TRANSACTION,!0)?Promise.resolve(!1):b.ob().then(()=>!0)}V(){return this.C.V()}create(a,b=new Map,c=this.source,d){c='string'===typeof c?c:olympe.dc.Xd().fromModel(a);a=this.C.create(a,d).Vh(c);for(const [e,f]of b)Z(a,e,f);b=a.X();this.F.push(b);return b}update(a,
1096
+ b,c){this.C.update(a,b,c);return this}cs(a,b){a=this.C.update(a);for(const [c,d]of b)b=d,a.Dd.set(olympe.dc.ga(c),b);return this}delete(a){this.C.delete(a);return this}Ha(a,b,c){this.C.Ha(a,b,c);return this}jc(a,b,c){this.C.jc(a,b,c);return this}Jm(a,b){this.C.Jm(a,b);return this}persist(a,b=!0){this.C.persist(a,b);return this}qy(a,b=!0){olympe.ma.hb('dc').warn('Transaction#persistInstance() has been deprecated. Please use Transaction#persist() instead.');return this.persist(a,b)}Vh(a){this.source=
1097
+ a;return this}model(a){return this.C.model(a)}merge(a){dl(this.C,a.C);return this}Cm(a){this.C.Cm(a);return this}ob(){return new Promise((a,b)=>{this.C.ob((c,d)=>{c?a(new olympe.sc.Ii(this.F)):b(d)})})}Km(){return new Promise((a,b)=>{this.C.Km((c,d)=>{c?a(new olympe.sc.Ii(this.F)):b(d)})})}};olympe.sc.Wa.prototype.executeAsLarge=olympe.sc.Wa.prototype.Km;olympe.sc.Wa.prototype.execute=olympe.sc.Wa.prototype.ob;olympe.sc.Wa.prototype.afterExecution=olympe.sc.Wa.prototype.Cm;
1098
+ 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.Vh;olympe.sc.Wa.prototype.persistInstance=olympe.sc.Wa.prototype.qy;olympe.sc.Wa.prototype.persist=olympe.sc.Wa.prototype.persist;olympe.sc.Wa.prototype.deleteAllRelations=olympe.sc.Wa.prototype.Jm;olympe.sc.Wa.prototype.deleteRelation=olympe.sc.Wa.prototype.jc;olympe.sc.Wa.prototype.createRelation=olympe.sc.Wa.prototype.Ha;
1099
+ olympe.sc.Wa.prototype['delete']=olympe.sc.Wa.prototype.delete;olympe.sc.Wa.prototype.multiUpdate=olympe.sc.Wa.prototype.cs;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.V;olympe.sc.Wa.process=olympe.sc.Wa.process;olympe.sc.Wa.from=olympe.sc.Wa.from;olympe.sc.Ii=class{constructor(a){this.C=a}Hw(){return this.C.map(olympe.dc.CloudObject.get)}};olympe.sc.Ii.prototype.getCreatedObjects=olympe.sc.Ii.prototype.Hw;olympe.xc={};olympe.xc.zs=class{run(){}};function nn(a,b='default'){return a.C===b}
1100
+ olympe.xc.Sa=class{constructor(a,b){this.C=a;this.H=b;this.F=null;this.G='';this.H.info('HC Manager will execute application registered as:',this.C)}ej(a,b,c=''){b||(b='default');b===this.C?(null===this.F?this.H.log('Application',c,'designated to be launched'):this.H.log('OVERRIDE: Application',c,'designated to be launched'),this.F=a,this.G=c):this.H.debug('ignoring application:'+c+' as it is registered under name '+b+' and not '+this.C)}run(){null!==this.F?(this.H.info('Running application:',this.G),
1101
+ this.F.run()):this.H.error('No app registered under name: '+this.C)}};olympe.xc.ej=function(a,b,c='default'){const d=a.hb();c?d.debug('Pre-registering application '+b+' under name '+c+' (use '+olympe.xc.U.Je+'='+c+' to start it)'):d.debug('Pre-registering application '+b+' as default one');a.vd(olympe.xc.R.Ea).config(c,[b],(e,f)=>f.ej(e,c,b),e=>nn(e,c),'olympe.hc.registerApp')};olympe.xc.R={Ea:'hc.Manager',Ca:'hc.Logger'};olympe.xc.U={Je:'hc.app',Xo:'hc.globalToken'};olympe.W.config(function(a){F(a,olympe.xc.U.Je,'default');F(a,olympe.xc.U.Xo,!1);E(a,olympe.xc.R.Ca,[olympe.ma.R.Ea],b=>b.Wc('hc'));E(a,olympe.Db.R.Fg,[new olympe.W.ja(olympe.xc.U.Je)],b=>b);E(a,olympe.auth.R.Nk,[olympe.Db.R.Fg,new olympe.W.ja(olympe.xc.U.Xo)],(b,c)=>new olympe.auth.Bn(c?'':b));D(a,olympe.xc.R.Ea,olympe.xc.Sa,new olympe.W.ja(olympe.xc.U.Je),olympe.xc.R.Ca)},'olympe.hc');
1102
+ olympe.W.run([olympe.xc.R.Ea],a=>a.run(),'olympe.hc');olympe.sc.Hb={};function on(a,b){if(a.ea)a.H.debug('Sending getContext request'),Th(a.ka).then(()=>{a.H.debug('synchronisation request successful');an=a.C;b()}).catch(c=>{a.H.error('failed to synchronise (authenticated) with server: '+c.message)});else{const c=rm(a.F);!c&&ok();a.H.debug((c?'PULLING':'SUBSCRIBING')+' application '+a.C);const d=a.F.F(),e=new olympe.async.Vq(d);e.add((f,g)=>{const h=olympe.dc.ia(),k=new olympe.D.Zb('Primordial Subscription Context',d);Jh(k,a.C,l=>{l=h.Th(l)?l:h.model(l);return null!==
1103
+ l&&h.Sb(l,olympe.sc.lg)},{Od:pn(c),kn:!0}).subscribe(rxjs.Subscriber.create(d.G(()=>{h.Sb(a.C,olympe.sc.qa.Sc)?(a.ua.Z(a.C,c),f()):dd(a.O)?g(`The specified application tag (${a.C}) is not an application or does not exist`):(k.destroy(),a.O.connect().catch(l=>{g(`Failed to load the app while offline, you might want to try again when online: ${l}`)}))}),l=>g(String(l))))});e.add(f=>{olympe.D.Oc([a.aa.ne()],g=>{const h=pn(c,!1);olympe.dc.pa.Ee(g,olympe.dm.User).observe(olympe.D.$a(),{Od:h,lk:'__code-as-data__'}).subscribe(()=>
1104
+ d.run(f))})});e.add((f,g)=>{if(qn(a.C)){const h=olympe.sc.Xc.Lb.Cp,k=olympe.sc.Xc.Lb.vi;cn(a.C,a.kb,l=>{l===h||l===k?d.run(f):d.run(()=>g('Error while loading the business container'))})}else f()});Rc(e,(f,g)=>{if(g)throw Error(g);b()});e.start()}}
1105
+ function rn(a){a.H.info('Starting application '+a.C);const b=olympe.D.ic(olympe.D.fa).update(olympe.D.fa.C),c=olympe.dc.ia();if(0<a.C.length){const d=af(c,a.C,a.F.F().G((g,h)=>{if(g)if(g=Tm(h),g instanceof olympe.sc.qa.$h){a.H.debug('application retrieved: running');h=pm(a.F,g);const k=new olympe.sc.Ya.Ou(a.K);$a(a.K,()=>Bm(a.F.C,k));ab(a.K,()=>{var l=k.V();return Dm(a.F.C,l)});a.Fa&&a.K.start();g.run(h);'string'===typeof a.ab&&(new olympe.sc.Qd).ea(g.X(),h,a.H);h.qs(olympe.sc.xa.C.sn).then(()=>{let l;
1106
+ null==(l=e)||l.cancel();b.update(olympe.D.fa.F);sn(a)})}else a.H.error('application retrieved: not an Application with a run() method');else tn(a)}));olympe.D.$a().onDestroy(()=>{Ze(c,a.C,d)});const e=jc(()=>{a.H.warn(`requested application ${a.C} may not be available (it may not exist or the logged user may not have the correct permissions)`)},3E4);let f;null==(f=a.vb)||f.start()}un(a);vn(a,b)}
1107
+ function sn(a){a.H.info(`Application ${olympe.dc.ia().name(a.C)} (${a.C}) started`);a=olympe.dc.sources.Vd();a.Ib=!0;a.Z+=0;a.ad.next(0<a.Z);0===a.Z&&a.aa&&a.Ib&&(a.H.debug(`Cache: set code-as-data version in local storage: ${a.version}`),a.ab.set('__code-as-data-version__',a.version),a.vb||(a.aa=!1))}function pn(a,b=!0){return a?olympe.dc.pa.$c.Yl:b?olympe.dc.pa.$c.Mf:olympe.dc.pa.$c.Xl}function tn(a){a.H.info('Stop the application');sn(a);a.F.F().ka();a.G.G(a.T);a.G.O(a.Z)}
1108
+ function un(a){a.Z=a.G.F(()=>v(function*(){return tn(a)}),'Stop application')}function vn(a,b){a.T=a.G.C(()=>olympe.D.Ma(b)===olympe.D.fa.F?Promise.resolve('The application is started'):Promise.reject('The application is not started'))}
1109
+ olympe.sc.Hb.fm=class{constructor(a,b,c,d,e,f,g,h,k,l){this.H=a;this.aa=b;this.O=c;this.ka=d;this.G=e;this.Z=this.T='';this.F=f;this.ua=g;this.K=h;this.vb=l;this.C=k.get('appTag');this.ea=k.get('getContextMode');let n;this.ab=null!=(n=k.get('debuggerName'))?n:null;this.Fa=k.get('autostartProfiler');this.kb=k.get('loadBusinessContainer')}run(){this.H.debug('runtime starting for app #'+this.C);let a=!1;const b=olympe.N.tc.C.zi,c=olympe.N.tc.C.de,d=olympe.N.tc.C.$d;olympe.D.Oc([this.O.getState()],e=>
1110
+ {switch(e){case b:case c:this.H.debug('Server session opened or working offline, start the application');a||(a=!0,on(this,()=>rn(this)));break;case d:this.H.debug('Impossible to open a connection to the orchestrator and offline mode is disabled.')}})}};olympe.sc.Hb.fm.C='app_instance';olympe.sc.Hb.fm.ya=[olympe.xc.zs];olympe.sc.Hb.Yu=class{constructor(a,b,c,d){this.H=a;this.F=b;this.G=d.get('httpManifestPath');this.C=d.get('manifestCommon');if(!this.C)this.C={};else if('string'===typeof this.C)try{this.C=JSON.parse(this.C)}catch(e){this.H.warn('Invalid manifest common config'),this.C={}}}start(){const a=b=>{this.H.debug('Request URL',b.C());const c=(new URL(b.C())).searchParams.get('origin');if(c)return c;b=b.Wi();this.H.debug('Request headers',JSON.stringify(b,null,2));return b.origin?b.origin:b.wy?(new URL(b.wy)).origin:
1111
+ b[olympe.net.Ba.Headers.Oo]&&b[olympe.net.Ba.Headers.Po]?b[olympe.net.Ba.Headers.Po]+'://'+b[olympe.net.Ba.Headers.Oo]:null};this.F.K('manifest',`${this.G}/:${'appTag'}`,[olympe.net.Ba.Sd.GET],(b,c)=>{const d=this;return v(function*(){var e=c.get('appTag');d.H.debug('Processing request to serve manifest for app',e);if(20!==e.length)return new olympe.net.ae('Invalid appTag',olympe.net.Ba.$b.Rk);try{var f=yield olympe.dc.pa.Ee(e,olympe.sc.qa.Sc).ob()}catch(h){return new olympe.net.ae(`Something went wrong: ${'string'===
1112
+ typeof h?h:h.message}`,olympe.net.Ba.$b.Rk)}if(0===f.size())return new olympe.net.ae('App not found',olympe.net.Ba.$b.Ml);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=
1113
+ {};else if('string'===typeof f)try{f=JSON.parse(f)}catch(h){d.H.warn(`Invalid manifest app config for app: ${e}`),f={}}e=Object.assign({},g,d.C,f);return new olympe.net.ae(JSON.stringify(e),olympe.net.Ba.$b.rh,void 0,{'content-type':'application/json'})})}).catch(()=>this.H.error('Error while starting the RuntimeHTTPService'));this.H.debug('Started RuntimeHTTPService')}};function qn(a){var b=olympe.dm.DataSource.SERVER;const c=olympe.dc.pa.from(a).gb(olympe.sc.qa.Sc.C).gb(olympe.dm.rd.G.cc()).gb(olympe.dm.rd.C).nd();a=olympe.dc.pa.from(a).gb(olympe.sc.qa.Sc.C).gb(olympe.dm.jb.F).nd();return c.concat(a).has(b)}
1114
+ olympe.sc.Hb.dk=class extends olympe.dc.sources.dk{T(a){return this.db.Sb(a,olympe.sc.Ec)}Z(a,b){if(!this.K){super.init();var c=olympe.dc.hd.from(a).gb(olympe.sc.qa.Sc.C).nd();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.pa.$c.Yl:olympe.dc.pa.$c.Mf;fk(this,c,b);c=new olympe.D.Zb('deployed data sources');olympe.dc.pa.from(a).gb(olympe.sc.qa.Sc.Fa).observe(c,{Od:b}).subscribe(d=>{const e=
1115
+ new olympe.dc.Wa;jf(d).forEach(f=>{e.Ha(olympe.dm.DataSource.dj,this.C,f)});hf(d).forEach(f=>{e.jc(olympe.dm.DataSource.dj,this.C,f)});e.ob()})}}};olympe.sc.Hb.R={Uf:'sc.runtime.Main',Se:'sc.runtime.SourceSolver',Dq:'sc.runtime.appConfig',Fq:'sc.runtime.runtimeHTTPServiceConfig',Eq:'sc.runtime.RuntimeHTTPService',Xp:'sc.runtime.OfflineAppConfig'};olympe.sc.Hb.U={gp:'app.httpManifestPath',Hp:'app.manifest.common',Dp:'sc.loadBusinessContainer'};
1116
+ olympe.W.config(function(a){F(a,olympe.sc.Hb.U.gp,'/runtime/manifest');F(a,olympe.sc.Hb.U.Hp,null);F(a,olympe.sc.Hb.U.Dp,!0);E(a,olympe.Db.R.Fg,[new olympe.W.ja(olympe.xc.U.Je),new olympe.W.ja(olympe.sc.U.Je)],(b,c)=>`${b}${c?'-'+c:''}`);E(a,olympe.sc.Hb.R.Xp,[new olympe.W.ja(olympe.sc.U.Je),new olympe.W.ja(olympe.net.U.yi),new olympe.W.ja(olympe.net.U.Ol)],(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`))?
1117
+ g:d;return new Map([['offlineEnabled',f],['offlineAutoBackOnline',!f||b]])});La(a,olympe.net.R.Pl,olympe.sc.Hb.R.Xp);D(a,olympe.sc.Hb.R.Se,olympe.sc.Hb.dk,olympe.dc.R.gh,new olympe.W.ja(olympe.dc.U.Dg),new olympe.W.ja(olympe.dc.U.ll));La(a,olympe.dc.sources.R.Se,olympe.sc.Hb.R.Se);E(a,olympe.sc.Hb.R.Dq,[new olympe.W.ja(olympe.sc.U.Je),new olympe.W.ja(olympe.dc.U.Ah),new olympe.W.ja(olympe.sc.U.qo),new olympe.W.ja(olympe.sc.U.un),new olympe.W.ja(olympe.sc.Hb.U.Dp)],(b,c,d,e,f)=>new Map([['appTag',
1118
+ b],['getContextMode',c],['debuggerName',d],['autostartProfiler',e],['loadBusinessContainer',f]]));D(a,olympe.sc.Hb.R.Uf,olympe.sc.Hb.fm,olympe.sc.R.Ca,olympe.auth.R.Ea,olympe.N.R.ff,olympe.dc.query.R.Qj,olympe.host.R.Qe,olympe.sc.R.Uj,olympe.sc.Hb.R.Se,olympe.Y.R.Tf,olympe.sc.Hb.R.Dq,olympe.sc.Hb.R.Eq);E(a,olympe.sc.Hb.R.Fq,[new olympe.W.ja(olympe.sc.Hb.U.gp),new olympe.W.ja(olympe.sc.Hb.U.Hp)],(b,c)=>new Map([['httpManifestPath',b],['manifestCommon',c]]));D(a,olympe.sc.Hb.R.Eq,olympe.sc.Hb.Yu,olympe.sc.R.Ca,
1119
+ olympe.net.R.Ki,olympe.sc.R.Uj,olympe.sc.Hb.R.Fq);olympe.xc.ej(a,olympe.sc.Hb.R.Uf,'sc.runtime');olympe.xc.ej(a,olympe.sc.Hb.R.Uf,'sc.headless');olympe.xc.ej(a,olympe.sc.Hb.R.Uf)},'olympe.sc.runtime');olympe.public={};olympe.public.La=class a{static xw(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 Je(olympe.public.La.get())}static Ck(b){return a.F(olympe.public.La.get().Ck(),b).pipe(rxjs.operators.map(c=>c.valueOf()))}static Jw(){return olympe.D.Ma(olympe.public.La.get().ne())}static ly(b){return a.F(olympe.public.La.get().ne(),b)}static me(){var b=olympe.D,c=b.Ma;var d=olympe.public.La.get().C.tb().wd();return c.call(b,
1120
+ d)}static eg(){return new Promise((b,c)=>{olympe.public.La.get().eg(d=>d?c(d):b())})}static Vw(){return olympe.D.Ma(olympe.public.La.get().Rh())||void 0}static yx(){const b=gd(olympe.public.La.get());return{user:b.Bc(),userTag:b.ne(),nonce:b.wd(),payload:b.oi(),idpName:b.mf(),protocol:b.tg()}}static Uw(){return Array.from(Ke().keys())}static cf(){olympe.public.La.get().cf()}static Ug(b){return new Promise((c,d)=>{olympe.public.La.get().Ug(b,e=>e?d(e):c())})}static Rx(b,c){return olympe.public.La.C((new Map).set('username',
1121
+ b).set('password',c),olympe.auth.Fc.C.SRP)}static Sx(b){const c=Ke();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.La.C((new Map).set('idpName',d),b)}static Qx(){return olympe.public.La.C(new Map,olympe.auth.Fc.C.SAML)}static Tx(b,c){return olympe.public.La.C((new Map).set('username',b).set('nonce',
1122
+ c),olympe.auth.Fc.C.Ql)}static Px(){return olympe.public.La.C(new Map,olympe.auth.Fc.C.OAUTH2)}static Uh(){return olympe.public.La.get().Uh()}static C(b,c){const d=new olympe.auth.Request;for(const [e,f]of b)d.set(e,f);return new Promise(e=>{Ie(olympe.public.La.get(),d,c,()=>{e()})})}static get(){return olympe.auth.ke()}static F(b,c){return b.asObservable('function'===typeof c.F?c.F():c)}};olympe.public.La.logout=olympe.public.La.Uh;olympe.public.La.loginOpenID=olympe.public.La.Px;
1123
+ olympe.public.La.loginToken=olympe.public.La.Tx;olympe.public.La.loginSAML=olympe.public.La.Qx;olympe.public.La.loginSSO=olympe.public.La.Sx;olympe.public.La.loginSRP=olympe.public.La.Rx;olympe.public.La.getUserFromToken=olympe.public.La.Ug;olympe.public.La.sendKeepAlive=olympe.public.La.cf;olympe.public.La.getIDPNames=olympe.public.La.Uw;olympe.public.La.getUserToken=olympe.public.La.yx;olympe.public.La.getIDPToken=olympe.public.La.Vw;olympe.public.La.refreshToken=olympe.public.La.eg;
1124
+ olympe.public.La.getToken=olympe.public.La.me;olympe.public.La.observeUser=olympe.public.La.ly;olympe.public.La.getCurrentUser=olympe.public.La.Jw;olympe.public.La.isAuthenticated=olympe.public.La.Ck;olympe.public.La.getState=olympe.public.La.getState;olympe.public.La.generateSRPData=olympe.public.La.xw;olympe.public.Aa=class{static create(a){return new class extends olympe.dc.$.hg{C(b,c){b=a(olympe.dc.CloudObject.get(c));if('boolean'===typeof b)return b;const d=olympe.D.ic(olympe.D.fa),e=b.subscribe(f=>d.update(olympe.D.Xb(f)));olympe.D.$a().Z(()=>e.unsubscribe());return d.tb()}}}};
1125
+ olympe.public.gf=class{static create(a){return new class extends olympe.dc.wc.hg{G(b,c){return olympe.dc.CloudObject.get(c)}compare(b,c){b=a(b,c);if('number'===typeof b)return b;const d=olympe.D.ic(olympe.D.ba),e=b.subscribe(f=>d.update(olympe.D.sa(f)));olympe.D.$a().Z(()=>e.unsubscribe());return d.tb()}}}};olympe.public.Process=class{static my(a,b){const c=olympe.host.vk(),d=c.C(a,b);return()=>c.G(d)}static ny(a,b){const c=olympe.host.vk(),d=c.F(a,b);return()=>c.O(d)}static connect(){return olympe.N.Nm().connect()}static disconnect(){return olympe.N.Nm().disconnect()}static cg(a){a='function'===typeof a.F?a.F():a;return olympe.N.Nm().cg().asObservable(a).pipe(rxjs.operators.map(b=>b.valueOf()))}};olympe.public.Process.isOnline=olympe.public.Process.cg;olympe.public.Process.disconnect=olympe.public.Process.disconnect;
1126
+ olympe.public.Process.connect=olympe.public.Process.connect;olympe.public.Process.onShutdown=olympe.public.Process.ny;olympe.public.Process.onHealthCheck=olympe.public.Process.my;'object'===typeof exports&&(exports={CloudObject:olympe.dc.CloudObject,Relation:olympe.dc.Na.Relation,Direction:olympe.dc.wa,generateTag:olympe.Y.Af,tagToString:olympe.dc.ga,register:olympe.dc.register,defineProperty:olympe.dc.defineProperty,defineRelation:olympe.dc.Cr,defineInverseRelation:olympe.dc.hw,BrickContext:olympe.sc.xa,Brick:olympe.sc.logic.Function,ActionBrick:olympe.sc.logic.Action,GlobalProperties:olympe.sc.xa.C,registerBrick:olympe.sc.logic.oa.C,FunctionBrick:olympe.sc.logic.Function,
1127
+ Context:olympe.sc.xa,Entry:olympe.dc.Na.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.Sf,EnumValue:olympe.sc.gi,DataSource:olympe.dm.DataSource,DataResult:olympe.dc.query.td,Workflow:olympe.sc.workflow.Workflow,WorkflowState:olympe.sc.workflow.Ue,WorkflowTransition:olympe.sc.workflow.Transition,
1128
+ WorkflowObjectState:olympe.sc.workflow.ObjectState,Transaction:olympe.sc.Wa,BurstTransaction:olympe.dc.bi,TransactionResult:olympe.sc.Ii,PredefinedDataSource:olympe.dc.Qa,QueryResult:olympe.dc.Pa,Query:olympe.dc.pa,QuerySingle:olympe.dc.hd,Predicate:olympe.dc.query.Aa,Order:olympe.dc.query.Nj,Config:class{static getParameter(a){return olympe.W.getParameter(a)}},Process:olympe.public.Process,Cache:{getCacheEntries:()=>olympe.dc.sources.Vd().O,clearCache:a=>vk(olympe.dc.sources.Vd(),a),getProcessingStatus:()=>
1129
+ olympe.dc.sources.Vd().Hc(),getProcessingErrors:()=>olympe.dc.sources.Vd().hc.asObservable(),hasPendingChanges:()=>olympe.dc.sources.Vd().ea.asObservable(),synchroniseChanges:()=>Bk(),getPendingChanges:()=>Ek(),clearPendingChanges:()=>Ik(),loadPendingChanges:a=>Gk(a)},Color:olympe.D.Color,ErrorFlow:olympe.sc.logic.Error,ServiceRequestType:olympe.N.cb.C,ServiceRequest:olympe.N.Tc,Service:olympe.N.yb,Auth:olympe.public.La,AuthState:{INIT:olympe.auth.Sa.C.INIT,AUTHENTICATING:olympe.auth.Sa.C.jj,GUEST:olympe.auth.Sa.C.ii,
1130
+ AUTHENTICATED:olympe.auth.Sa.C.df,ERROR:olympe.auth.Sa.C.zb},AuthProtocol:olympe.auth.Fc.C,Sync:olympe.dc.CloudObject,BusinessObject:olympe.dc.CloudObject,StringPrimitive:olympe.dm.String,NumberPrimitive:olympe.dm.Number,BooleanPrimitive:olympe.dm.Boolean,DatetimePrimitive:olympe.dm.DateTime,ColorPrimitive:olympe.dm.Color,PropertyPrimitive:olympe.dm.Property,RelationPrimitive:olympe.dm.Relation,DBView:class extends olympe.dc.lb{static get(){return olympe.dc.ia()}},ListDef:olympe.dc.za,instanceToTag:olympe.dc.ga,
1131
+ registerSync:olympe.dc.oa.C,getUniqueTag:olympe.Y.Af,onDestroy:a=>olympe.D.$a().onDestroy(a),offDestroy:a=>olympe.D.$a().If(a),FollowRules:olympe.dc.Ob,transformers:{Related:olympe.dc.da.Re,RecursiveRelated:olympe.dc.da.ye,Distinct:olympe.dc.da.ei,Filter:olympe.dc.da.jf,Limit:olympe.dc.da.oh,Sort:olympe.dc.da.Gg,Union:olympe.dc.da.vf},ListDefPredicate:olympe.public.Aa,predicates:{And:olympe.dc.$.Fd,Or:olympe.dc.$.we,Not:olympe.dc.$.ce,Equals:olympe.dc.$.se,Contains:olympe.dc.$.hf,Greater:olympe.dc.$.Aj,
1132
+ Smaller:olympe.dc.$.ck,HasRelated:olympe.dc.$.ki,InstanceOf:olympe.dc.$.ni,Regex:olympe.dc.$.sf},Comparator:olympe.public.gf,comparators:{Number:olympe.dc.wc.Number,String:olympe.dc.wc.String,DateTime:olympe.dc.wc.DateTime},valuedefs:{BooleanProperty:olympe.dc.Za.mj,StringProperty:olympe.dc.Za.Ei,NumberProperty:olympe.dc.Za.xi,DateTimeProperty:olympe.dc.Za.di,Constant:olympe.dc.Za.Le,Tag:olympe.dc.Za.Gi}});
1131
1133
 
1132
1134
 
1133
1135
  }.bind(this))();